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
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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ec0e9bb184276dcd8d0a298f9409e38ae5589af838596b3b59e97d6ab506a42
|
|
| MD5 |
cf7658b66a8047cc6baf0eeb276e96fe
|
|
| BLAKE2b-256 |
538e6670fb7dfb884fdd5d82699c73ff4add1fd755bfb882568b6e272ae80c12
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e61fd2cb8b514266ff5dda6d47226152a138de01517733552849d122365eae2e
|
|
| MD5 |
b012dafcadd2f97f9c5386865052e0ca
|
|
| BLAKE2b-256 |
441bb4d95ebd6817c7de5fa2178dccdaecf75896228535a3bd632d73fcd2830e
|