Supported in: Batch
Computes ROUGE precision, recall, and F-measure for predicted and target text. Text is lowercased; only ASCII letters and digits are compared. All other characters are treated as word separators. Returns null if either input is null or the text cannot be scored, including when it exceeds the scorer's size limits.
Expression categories: Distance measurement, String
Output type: Struct<precision, recall, fmeasure>
Description: Only ASCII letters and digits are compared after lowercasing; other characters separate words. Text without any tokens scores zero, even when the inputs are identical.
Argument values:
predictionrouge1target| prediction | target | Output |
|---|---|---|
| 你好 | 你好 | { fmeasure: 0.0, precision: 0.0, recall: 0.0, } |
| cat你好dog | cat dog | { fmeasure: 1.0, precision: 1.0, recall: 1.0, } |
| CAT 42 | cat 42 | { fmeasure: 1.0, precision: 1.0, recall: 1.0, } |
| empty string | empty string | { fmeasure: 0.0, precision: 0.0, recall: 0.0, } |
Description: ROUGE-2 measures overlap between adjacent pairs of words.
Argument values:
predictionrouge2target| prediction | target | Output |
|---|---|---|
| the cat sat | the cat slept | { fmeasure: 0.5, precision: 0.5, recall: 0.5, } |
Argument values:
predictionrouge1target| prediction | target | Output |
|---|---|---|
| the cat sat | the cat sat | { fmeasure: 1.0, precision: 1.0, recall: 1.0, } |
Description: ROUGE-L measures the longest sequence of words appearing in the same order.
Argument values:
predictionrouge_ltarget| prediction | target | Output |
|---|---|---|
| cat sat | sat cat | { fmeasure: 0.5, precision: 0.5, recall: 0.5, } |
Description: ROUGE-Lsum uses newlines to separate sentences; punctuation alone does not split them.
Argument values:
predictionrouge_lsumtarget| prediction | target | Output |
|---|---|---|
| cat sat. dog ran. | dog ran. cat sat. | { fmeasure: 1.0, precision: 1.0, recall: 1.0, } |
| cat sat. dog ran. | dog ran. cat sat. | { fmeasure: 0.5, precision: 0.5, recall: 0.5, } |
Description: ROUGE-1 measures overlap between individual words.
Argument values:
predictionrouge1target| prediction | target | Output |
|---|---|---|
| the cat sat | the cat slept | { fmeasure: 0.6666666666666666, precision: 0.6666666666666666, recall: 0.6666666666666666, } |
Description: Stemming allows related word forms to match.
Argument values:
predictionrouge1target| prediction | target | Output |
|---|---|---|
| cars | car | { fmeasure: 1.0, precision: 1.0, recall: 1.0, } |
Description: ROUGE-Lsum sentences automatically detects sentence boundaries and compares sentence-level matches without penalizing sentence reordering.
Argument values:
predictionrouge_lsum_sentencestarget| prediction | target | Output |
|---|---|---|
| The dog ran. The cat sat. | The cat sat. The dog ran. | { fmeasure: 1.0, precision: 1.0, recall: 1.0, } |
| Cat sat. Dog ran. | Dog ran. Cat sat. | { fmeasure: 1.0, precision: 1.0, recall: 1.0, } |
Description: ROUGE-3 measures overlap between adjacent groups of three words.
Argument values:
predictionrouge3target| prediction | target | Output |
|---|---|---|
| the cat sat down | the cat sat still | { fmeasure: 0.5, precision: 0.5, recall: 0.5, } |
| the cat | the cat | { fmeasure: 0.0, precision: 0.0, recall: 0.0, } |
Description: If either input is null, the entire ROUGE score output is null.
Argument values:
predictionrouge1target| prediction | target | Output |
|---|---|---|
| null | target | null |
| prediction | null | null |
| null | null | null |