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.0.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.0-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for uci_phonotactic_calculator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fbe9b9499e0c892fa0d29355a3a947d6923e3d2ea5fb70f0bb4c48ac5baffaf3
MD5 5c0ff6ed54ca191aa7daa940f008a7cb
BLAKE2b-256 77af5e92f9e700f676c0c5254c11e3ae76d1a842001699cf53d8528986cce595

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for uci_phonotactic_calculator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e505e228e6232e9b4d3c25ce7c6af9af9b6ccee28a28eb9bab1543af0eacf261
MD5 4d001a6e88cc4ca201da6c8f6b874ec8
BLAKE2b-256 e3cb64cadadaef63b6ee83ebdc9cda86138effabf52051c4eec5d602b7a839ed

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