explaingit

dhellmann/sacrebleu

Analysis updated 2026-07-07 · repo last pushed 2024-07-27

Audience · researcherComplexity · 2/5StaleLicenseSetup · easy

TLDR

SacreBLEU is a Python tool that computes BLEU scores to measure machine translation quality, standardizing the calculation so results are comparable across papers and products.

Mindmap

mindmap
  root((repo))
    What it does
      Computes BLEU scores
      Standardizes metric calculation
      Auto downloads test sets
      Generates version signatures
    Metrics
      BLEU score
      chrF score
      Translation Error Rate
    Tech stack
      Python
      JSON output
      Auto dataset download
    Use cases
      Score translation output
      Compare translation models
      Document evaluation settings
    Audience
      Machine learning researchers
      NLP engineers
      Translation teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Score your machine translation output against standard reference datasets like wmt17.

USE CASE 2

Compare translation quality across different models or experiments using consistent BLEU calculations.

USE CASE 3

Evaluate translations for languages like Japanese, Korean, and Chinese with specialized text-splitting rules.

USE CASE 4

Generate JSON-formatted scores with version signatures so others can verify and reproduce your results.

What is it built with?

PythonBLEUchrFTER

How does it compare?

dhellmann/sacrebleu0xhassaan/nn-from-scratch0xzgbot/hermes-comfyui-skills
Stars00
LanguagePython
Last pushed2024-07-27
MaintenanceStale
Setup difficultyeasymoderateeasy
Complexity2/54/51/5
Audienceresearcherdeveloperdesigner

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Install via pip, it automatically downloads reference datasets when you first run a test set.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

If you're building a machine translation system, you need a way to measure how good the translations actually are. SacreBLEU is a tool that computes BLEU scores, the standard metric the research community uses to grade translation quality. The core problem it solves is that different teams often calculate BLEU slightly differently, making it nearly impossible to compare results fairly across papers or products. This tool standardizes that process so everyone is on the same page. The tool works by taking your system's translated text and comparing it against a known, high-quality reference translation. The standout convenience is that it automatically downloads and manages those standard reference test sets for you. Instead of hunting down files on your computer, you just tell it to score against "wmt17," and it handles the rest. It also applies the correct text processing rules (like how to split words and punctuation) and generates a short version string that documents exactly how the score was calculated, so others can verify your work. Machine learning researchers, NLP engineers, and anyone evaluating translation systems would use this. For example, if your team just built a new English-to-German translator, you'd run your output through the tool to get a definitive score. It also supports additional metrics like chrF and Translation Error Rate, and includes specialized tokenizers for languages like Japanese, Korean, and Chinese, which require different text-splitting rules than English. A notable design choice is its emphasis on reproducibility. The version signature it attaches to every score acts as a receipt, showing the exact settings used. As of version 2.0.0, it also outputs results in JSON format by default, making it much easier for other software to parse the scores programmatically. This focus on standardized, hassle-free computation makes it a trusted standard in the translation community.

Copy-paste prompts

Prompt 1
Install SacreBLEU and score my English-to-German translations in translations.txt against the wmt17 test set, outputting the result as JSON.
Prompt 2
Use SacreBLEU to compute both BLEU and chrF scores for my Chinese translation output, making sure to use the built-in Chinese tokenizer.
Prompt 3
Generate a SacreBLEU version signature for my latest translation evaluation so I can include it in my research paper for reproducibility.
Prompt 4
Set up SacreBLEU to automatically download the wmt17 reference dataset and score my system's output, then explain what the version string in the result means.

Frequently asked questions

What is sacrebleu?

SacreBLEU is a Python tool that computes BLEU scores to measure machine translation quality, standardizing the calculation so results are comparable across papers and products.

Is sacrebleu actively maintained?

Stale — no commits in 1-2 years (last push 2024-07-27).

What license does sacrebleu use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is sacrebleu to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is sacrebleu for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.