ter
TER Translation Error Rate automated machine translation evaluation
measure_ter
measure_ter (hypothesis_lines, reference_lines, normalized=False, no_punct=False, asian_support=False, case_sensitive=False)
Measuring TER on set of hypotheses and references
Type | Default | Details | |
---|---|---|---|
hypothesis_lines | List | Array of hypotheses. | |
reference_lines | List | Array of references. | |
normalized | bool | False | If True , applies basic tokenization to sentences. |
no_punct | bool | False | If True , removes punctuations from sentences. |
asian_support | bool | False | If True , adds support for Asian character processing. |
case_sensitive | bool | False | If True , does not lowercase sentences. |
Returns | Tuple | Array of arrays containing TER score, number of edits and reference length and sacreBLEU TER score in JSON format. |
measure_record_ter
measure_record_ter (hypothesis_lines, reference_lines, sourcelang, targetlang, test_set_name, test_date, mtengine, score_pathname, score_fname, domain='', normalized=False, no_punct=False, asian_support=False, case_sensitive=False)
Score hypothesis with TER score and record it to a specified metrics file
Type | Default | Details | |
---|---|---|---|
hypothesis_lines | List | Array of hypotheses. | |
reference_lines | List | Array of references. | |
sourcelang | str | Source language identifier. | |
targetlang | str | Target language identifier. | |
test_set_name | str | Name of test set. | |
test_date | str | Date of test as ISO-8601 formatted string. | |
mtengine | str | Name of the tested MT engine. | |
score_pathname | str | Path for results CSV file. | |
score_fname | str | File name for results CSV file. | |
domain | str | Domain string if applicable. | |
normalized | bool | False | If True , applies basic tokenization to sentences. |
no_punct | bool | False | If True , removes punctuations from sentences. |
asian_support | bool | False | If True , adds support for Asian character processing. |
case_sensitive | bool | False | If True , does not lowercase sentences. |