Learn R Programming

sacRebleu

The goal of sacRebleu is to provide a simple interface to the BLEU score, a metric for evaluating the quality of generated text. This package is inspired by the NLTK and sacrebleu implementations of the BLEU score, and is implemented in C++ for the R programming language.

Installation

You can install the development version of sacRebleu from GitHub with:

Installation

# install.packages("devtools")
devtools::install_github("LazerLambda/sacRebleu")

Example

library(sacRebleu)
cand_corpus <- list("This is good", "This is not good")
ref_corpus <- list(list("Perfect outcome!", "Excellent!"), list("Not sufficient.", "Horrible."))
bleu_corpus <- bleu_corpus(ref_corpus, cand_corpus)

Copy Link

Version

Install

install.packages('sacRebleu')

Monthly Downloads

115

Version

0.2.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Philipp Koch

Last Published

January 22nd, 2025

Functions in sacRebleu (0.2.0)

validate_references

Validate References
bleu_sentence_ids

Computes BLEU-Score (Papineni et al., 2002).
validate_arguments

Validate Arguments
bleu_corpus_ids

Computes BLEU score (Papineni et al., 2002).
sacRebleu

sacRebleu: An R package for calculating BLEU scores