The Length Ratio metric.
The Length Ratio metric calculates the ratio of the length of the target text to the length of the closest reference text.
Configuration
Configuration for the parameters of the Length Ratio metric:
title: "LengthRatioConfig"
type: "object"
$defs:
TokenizerSpec:
type: "object"
properties:
name:
type: "string"
description: "Name of the tokenizer to be used."
config:
type: "object"
description: >
"Any additional configuration that tokenizer needs. "
"This will be in the form specified by the JSONSchema for that tokenizer."
required:
- "name"
- "config"
properties:
tokenizer:
$ref: "#/$defs/TokenizerSpec"
Data
Accepted data format of the Length Ratio metric:
title: "LengthRatioData"
type: "object"
properties:
target:
type: "string"
description: "Input text to evaluate."
references:
type: "array"
description: "The references to evaluate the target against."
items:
type: "string"
required:
- "target"
Results
Format of the results of the Length Ratio metric:
title: "LengthRatioResult"
type: "object"
$defs:
LengthRatioStats:
type: "object"
properties:
value:
type: "number"
description: "Length ratio of target/reference."
target_length:
type: "number"
description: "Length of the target sentence."
reference_length:
type: "number"
description: "Length of the reference sentence."
required:
- "value"
properties:
overall:
$ref: "#/$defs/LengthRatioStats"
examples:
type: "array"
items:
$ref: "#/$defs/LengthRatioStats"
required:
- "overall"
- "examples"