{"id":"bleu-sentence-components","version":"1.0.0","description":"Extract sentence BLEU statistics: clipped matches, n-gram totals, candidate and closest reference length.","supported_operations":["sentence BLEU statistics for one hypothesis","matched and total n-grams of a single translation","hypothesis length and closest reference length for BLEU","clipping table of one sentence against its references","inputs for BLEU smoothing from tokenized sentence","why did my sentence get a low BLEU","רכיבי ציון התרגום של משפט אחד"],"unsupported_operations":["the BLEU score itself (use bleu-sentence-compute or bleu-smoothing-compute)","smoothed counts (bleu-smoothing-compute applies Chen and Cherry smoothing)","tokenizing, lowercasing or normalizing raw text","statistics summed over a multi-sentence corpus (deep10-bleu-corpus)"],"semantics":["hypothesis is one token list and references 1 to 8 token lists; tokens are compared by exact string equality (no case folding, no Unicode normalization). max_order omitted means 4.","matches[n-1] = sum over distinct hypothesis n-grams g of min(count(g), largest count of g in any single reference); totals[n-1] = max(0, c - n + 1) (Papineni 2002 section 2.1).","candidate_length c = number of hypothesis tokens; reference_length r = the reference length closest to c, ties to the shorter (mteval-v13a, NLTK, sacreBLEU).","include_ngrams omitted means false. With true, ngrams lists every distinct hypothesis n-gram with count, max_reference_count and clipped_count, ordered by order then first occurrence; output over 1,000,000 UTF-8 bytes is limit_exceeded.","The statistics are exactly the matches/totals/candidate_length/reference_length inputs of bleu-smoothing-compute."],"limits":{"max_references":8,"max_total_tokens":10000,"max_token_bytes":128,"max_total_token_bytes":262144,"max_output_bytes":1000000},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["hypothesis","references"],"properties":{"hypothesis":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"references":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"array","items":{"type":"string","minLength":1,"maxLength":128}}},"max_order":{"type":"integer","minimum":1,"maximum":8},"include_ngrams":{"type":"boolean"}}},"output_schema":{"type":"object","additionalProperties":false,"required":["candidate_length","reference_length","max_order","matches","totals"],"properties":{"candidate_length":{"type":"integer","minimum":0},"reference_length":{"type":"integer","minimum":0},"max_order":{"type":"integer","minimum":1,"maximum":8},"matches":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"integer","minimum":0}},"totals":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"integer","minimum":0}},"ngrams":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["order","ngram","count","max_reference_count","clipped_count"],"properties":{"order":{"type":"integer","minimum":1,"maximum":8},"ngram":{"type":"array","minItems":1,"maxItems":8,"items":{"type":"string"}},"count":{"type":"integer","minimum":1},"max_reference_count":{"type":"integer","minimum":0},"clipped_count":{"type":"integer","minimum":0}}}}}},"examples":[{"input":{"hypothesis":["am","I","am","a","character","sequence"],"references":[["I","am","a","symbol","string","sequence","a","a"]]},"output":{"candidate_length":6,"reference_length":8,"max_order":4,"matches":[4,2,1,0],"totals":[6,5,4,3]}},{"input":{"hypothesis":["the","the","the"],"references":[["the","cat","on","the","mat"],["a","cat"]],"max_order":1,"include_ngrams":true},"output":{"candidate_length":3,"reference_length":2,"max_order":1,"matches":[2],"totals":[3],"ngrams":[{"order":1,"ngram":["the"],"count":3,"max_reference_count":2,"clipped_count":2}]}}],"execute_url":"/v1/tools/bleu-sentence-components/versions/1.0.0/execute"}