Skip to main content

A library for calculating fertility and parity scores with visualizations using tokenizers.

Project description

pytoke

pytoke is a Python library that calculates fertility and parity scores for text using tokenizers from the transformers library. It also provides visualization tools to analyze token metrics across datasets.

Features

  • Fertility Score: Calculate the ratio of token count to word count for a given text.
  • Parity Score: Compare token counts between two texts (e.g., original and translated).
  • TokenMetrics Class: Easily process and visualize token metrics for a dataset.

Installation

Install pytoke using pip:

pip install pytoke

Works Cited

Parity calculation from https://arxiv.org/abs/2305.15425 (page 3).

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

pytoke-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

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

pytoke-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file pytoke-0.1.0.tar.gz.

File metadata

  • Download URL: pytoke-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for pytoke-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5ec0e9bb184276dcd8d0a298f9409e38ae5589af838596b3b59e97d6ab506a42
MD5 cf7658b66a8047cc6baf0eeb276e96fe
BLAKE2b-256 538e6670fb7dfb884fdd5d82699c73ff4add1fd755bfb882568b6e272ae80c12

See more details on using hashes here.

File details

Details for the file pytoke-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pytoke-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.8

File hashes

Hashes for pytoke-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e61fd2cb8b514266ff5dda6d47226152a138de01517733552849d122365eae2e
MD5 b012dafcadd2f97f9c5386865052e0ca
BLAKE2b-256 441bb4d95ebd6817c7de5fa2178dccdaecf75896228535a3bd632d73fcd2830e

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