Skip to main content

A toolkit for phonotactic probability calculation and analysis.

Project description

UCI Phonotactic Calculator

Easily score wordlists with classic and positional-n-gram phonotactic models — right from the command line or a friendly web interface.


✨ What can I do with it?

Task One-liner
Score a test list with the default model python -m uci_phonotactic_calculator.main train.csv test.csv out.csv
Try the demo data set, using an english training file and english test file make demo
Launch a Django web interface make django
Launch an interactive web UI (Gradio) make web

The output is a CSV that adds phonotactic scores next to each word, ready for Excel or Pandas.


🚀 Quick install

# 1. (Optional) create and activate a virtual environment
python -m venv venv
source venv/bin/activate   # on Windows: venv\Scripts\activate

# 2. Install the core package
pip install uci-phonotactic-calculator

That’s it! If you need the web UI, just add the extra tag:

pip install "uci-phonotactic-calculator[ui]"

🏃 Your first run

# Train on English, score the sample test set, write results to scores.csv
python -m uci_phonotactic_calculator.main data/english.csv \
       data/sample_test_data/english_test_data.csv \
       scores.csv

Don’t have your own data yet? Use the built-in demo corpus:

python -m uci_phonotactic_calculator.main --use-demo-data scores.csv

You’ll get a CSV like:

word word_len ngram_bound_conditional
CAT 3 -3.87

🖥️ Django interface (optional)

Prefer point-and-click? Fire up the Django web interface:

make django      # or: python -m uci_phonotactic_calculator.web.django.webcalc

A browser window opens where you can drop CSVs, tweak a few options, and download scores.


🖥️ Gradio interface (optional)

Prefer point-and-click? Fire up the Gradio UI:

make web      # or: python -m uci_phonotactic_calculator.web.web_demo

A browser window opens where you can drop CSVs, tweak a few options, and download scores.


📚 Want to go deeper?

  • Run python -m uci_phonotactic_calculator.main --help for all flags.
  • Developers can install extras with pip install ".[dev]" and check out CONTRIBUTING.md.
  • Full docs & citation info: https://phonotactics.socsci.uci.edu/

✏️ Citation

If this tool helps your research, please cite:

Mayer, C., Kondur, A., & Sundara, M. (2022). UCI Phonotactic Calculator (v0.1.0). https://doi.org/10.5281/zenodo.7443706

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

uci_phonotactic_calculator-1.0.1.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

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

uci_phonotactic_calculator-1.0.1-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

File details

Details for the file uci_phonotactic_calculator-1.0.1.tar.gz.

File metadata

File hashes

Hashes for uci_phonotactic_calculator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c13c6cfa09ca8f2fea97a948533036357cce459a2f392726d088e0dbd9e7c544
MD5 8e209e3f67c45d117d96e76631dc205d
BLAKE2b-256 43d48194f9b4520e4dd2027f9366db093bab0c4526d4791437acda6722bea375

See more details on using hashes here.

File details

Details for the file uci_phonotactic_calculator-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for uci_phonotactic_calculator-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c66c7cd38cc28c62faf79c3c68be4950cdfe67064a1cde581748efbcc64f413
MD5 8f771d390f8c440807d9acb52f8be9a2
BLAKE2b-256 e086b41aa61756d40dab17edcdb0e136b4185b5008fb07e3a8a2fdc64702636f

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