bleu: BLEU (Bilingual Evaluation Understudy)

Description Usage Arguments Value Examples

Description

BLEU score calculations over a data frame.

Usage

1
bleu(.data, n = 4)

Arguments

.data

A list, where each candidate has multiple references (dataframe that was transformed into a list by another function in this package)

n

desired number of ngrams (defaults to 4)

Value

tibble with data in long form. Each row contains the BLEU score for each ngram value for each candidate-reference pair.

Examples

1
2
3
4
5
6
7
8
# Our candidate and reference data
sample_data <- list(list(candidate = "The cat the cat on the mat", references = c("The cat is on the mat", "There is a cat on the mat")),
list(candidate = "The cat the cat on the map", references = c("The cat is on the ccccccat", "There is a cat on the mat")))



# Run function
bleu(sample_data)

kanishkamisra/footrulr documentation built on May 23, 2019, 5:07 p.m.