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.2.tar.gz
(12.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crystalbleu-0.2.tar.gz.
File metadata
- Download URL: crystalbleu-0.2.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
883a745259a69cf3b089044ed375702e57bcdc00b3f2454842ca6f7f9b900b8e
|
|
| MD5 |
2e4c518407d10e5a3d4e3f705a24045e
|
|
| BLAKE2b-256 |
05f9e57c344501790f8638f9662edeff7de95b7e00d61ed41805b5c018e04bab
|
File details
Details for the file crystalbleu-0.2-py2.py3-none-any.whl.
File metadata
- Download URL: crystalbleu-0.2-py2.py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0eb9c47ee0bb953faec0e9017e732188d0297026da669d1b7942b0a1c3e4ef58
|
|
| MD5 |
a3f5a0543e57e4210e83a6629c2d9f15
|
|
| BLAKE2b-256 |
2225fa83423e31c5b3ec2199a716c87467df7e12d8822145774d5269ca0b53e9
|