CrystalBLEU score implementation.
Project description
CrystalBLEU
Install
Install the requirements:
pip install crystalbleu
Usage
from collections import Counter
# Import CrystalBLEU
from crystalbleu import corpus_bleu
# Extract trivially shared n-grams
k = 500
frequencies = Counter(tokenized_corpus)
trivially_shared_ngrams = dict(frequencies.most_common(k))
# Calculate CrystalBLEU
crystalBLEU_score = corpus_bleu(
references, candidates, ignoring=trivially_shared_ngrams)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
crystalbleu-0.1.tar.gz
(11.8 kB
view hashes)
Built Distribution
Close
Hashes for crystalbleu-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24833eb0f7e1c02a53a86603df35a3045142425b07e490233536290972af0a40 |
|
MD5 | b63d0ccc2a56fbe0a29e3d5e8d55fd40 |
|
BLAKE2b-256 | f4c1bd1d9e5b4fbad470af977b77b0ab48bde56048fa25f1f4d8698dcce46f57 |