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 details)
Built Distribution
File details
Details for the file crystalbleu-0.1.tar.gz
.
File metadata
- Download URL: crystalbleu-0.1.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 334828cf3f4f45b0ab94a52cbb0f950ac2b684db1e61ebb1d28e21c791ccd43b |
|
MD5 | 42c69945e3ab4362aac359e1ec53006c |
|
BLAKE2b-256 | 9c5af347e30ebdcf1090b104c839ea668ad5c285d48ecdc9e0cf86afaf6ede1c |
File details
Details for the file crystalbleu-0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: crystalbleu-0.1-py2.py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24833eb0f7e1c02a53a86603df35a3045142425b07e490233536290972af0a40 |
|
MD5 | b63d0ccc2a56fbe0a29e3d5e8d55fd40 |
|
BLAKE2b-256 | f4c1bd1d9e5b4fbad470af977b77b0ab48bde56048fa25f1f4d8698dcce46f57 |