Method to get a words probability with fixes from How to Compute the Probability of a Word.
Project description
probability-of-a-word
Code to compute a word's probability using the fixes from "How to Compute the Probability of a Word"
Installation
You can install WordsProbability directly from PyPI:
pip install wordsprobability
Or from source:
git clone git@github.com:tpimentelms/probability-of-a-word.git
cd probability-of-a-word
pip install -e .
Dependencies
WordsProbability has the following requirements:
Usage
Basic Usage
Install this repository. Then run:
$ wordsprobability --model pythia-70m --input examples/abstract.txt --output temp.tsv
The output will be a tsv file with a word per row with its respective computed surprisal and surprisal_fixed values.
Currently, supported models are: pythia-70m, pythia-160m, pythia-410m, pythia-14b, pythia-28b, pythia-69b, pythia-120b, gpt-small, gpt-medium, gpt-large, gpt-xl.
Extra Information
Citation
If this code or the paper were usefull to you, consider citing it:
@article{pimentel-etal-2024-howto,
title = "How to Compute the Probability of a Word",
author = "Pimentel, Tiago and
Meister, Clara",
year = "2024",
eprint = {2406.14561},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2406.14561},
journal = "arXiv preprint arXiv:2406.14561",
}
Contact
To ask questions or report problems, please open an issue.
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
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 wordsprobability-0.1.tar.gz.
File metadata
- Download URL: wordsprobability-0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
905fd76056723b42aa02b5aa606e21a572ae5ae43d8c767896647b27bb5c8bf9
|
|
| MD5 |
b48dbf492427f9cefb24b388a866c3df
|
|
| BLAKE2b-256 |
f9a3b5cff8d7f22848deb98edd2f1837789c7ef96026105ace5caad2e36d5693
|
File details
Details for the file wordsprobability-0.1-py3-none-any.whl.
File metadata
- Download URL: wordsprobability-0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf560fe706dbfcf370cd39d2fc26a3228653beaddfc1f1abc6f1a99b031d3a97
|
|
| MD5 |
d0db75114c27a9f2a073f249a966c1ae
|
|
| BLAKE2b-256 |
38405179cbf03b4fc613b8cb9fa11aa844881ad0f09a9dd88fa056b663a6309f
|