Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crystalbleu-0.2-py2.py3-none-any.whl (12.6 kB view details)

Uploaded Python 2Python 3

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

Hashes for crystalbleu-0.2.tar.gz
Algorithm Hash digest
SHA256 883a745259a69cf3b089044ed375702e57bcdc00b3f2454842ca6f7f9b900b8e
MD5 2e4c518407d10e5a3d4e3f705a24045e
BLAKE2b-256 05f9e57c344501790f8638f9662edeff7de95b7e00d61ed41805b5c018e04bab

See more details on using hashes here.

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

Hashes for crystalbleu-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0eb9c47ee0bb953faec0e9017e732188d0297026da669d1b7942b0a1c3e4ef58
MD5 a3f5a0543e57e4210e83a6629c2d9f15
BLAKE2b-256 2225fa83423e31c5b3ec2199a716c87467df7e12d8822145774d5269ca0b53e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page