๐งฎ UCI Phonotactic Calculator
Instant phonotactic scores from n-gram models
Welcome to the UCI Phonotactic Calculator!
This is a research tool that allows users to calculate a variety of phonotactic metrics. These metrics are intended to capture how probable a word is based on the sounds it contains and the order in which those sounds are sequenced.
For example, a nonce word like [stik] 'steek' might have a relatively high phonotactic score in English even though it is not a real word, because there are many words that begin with [st], end with [ik], and so on. In Spanish, however, this word would have a low score because there are no Spanish words that begin with the sequence [st]. A sensitivity to the phonotactic constraints of one's language(s) is an important component of linguistic competence, and the various metrics computed by this tool instantiate different models of how this sensitivity is operationalized.
The general use case for this tool is as follows:
Choose a training file. You can either upload your own or choose one of the default training files (see the About page for details on how these should be formatted and the Datasets page for a description of the default files). This file is intended to represent the input over which phonotactic generalizations are formed, and will typically be something like a dictionary (a large list of word types). The models used to calculate the phonotactic metrics will be fit to this data.
Upload a test file. The trained models will assign scores for each metric to the words in this file. This file may duplicate data in the training file (if you are interested in the scores assigned to existing words) or not (if you are interested in the predictions the various models make about how speakers generalize to new forms).
The calculator computes a suite of metrics that are based on unigram/bigram frequencies (that is, the frequencies of individual sounds and the frequencies of adjacent pairs of sounds). This includes type- and token-weighted variants of the positional unigram/bigram method from Jusczyk et al. (1994) and Vitevitch and Luce (2004), as well as type- and token-weighted variants of standard unigram/bigram probabilities. See the About page for a detailed description of how these models differ and how to interpret the scores.
Citing the UCI Phonotactic Calculator
If you publish work that uses the UCI Phonotactic Calculator, please cite the GitHub repository:
Mayer, C., Kondur, A., & Sundara, M. (2022). UCI Phonotactic Calculator (Version 0.1.0) [Computer software]. https://doi.org/10.5281/zenodo.7443706
๐ Step 1: Choose Your Data
- Upload your own files: Use CSV files with a 'word' column
- Try the demo: Click "Load Demo Data" for sample English words
โ๏ธ Step 3: Configure Settings
- N-gram Order: How many characters to consider (2-4 recommended)
- Advanced Options: Fine-tune probability calculations
๐ง Step 2: Select a Model
- N-gram Model: Classic phonotactic probability
- Positional N-gram: Position-aware analysis (more sophisticated)
๐ Step 4: Calculate & Download
- Click "Calculate Phonotactic Scores" to process your data
- View results in the preview table
- Download the complete scored dataset as CSV
๐ 1. Training Data
Choose the corpus to train your phonotactic model
Click to browse and upload CSV file
Use demo training + test files
๐ฏ 2. Test Data
Upload the words you want to score
CSV with test words (one column)
๐ง Model Settings
Configure the phonotactic calculation parameters
Choose phonotactic model
Higher = longer patterns
๐๏ธ Advanced Options
Fine-tune calculation settings
Weight Mode
Frequency weighting
Probability Mode
Calculation method
โถ๏ธ Run Calculation
Click the button below to calculate phonotactic scores based on your selected data and model settings.
Preview
Download
๐ Dataset Overview
The calculator includes several pre-loaded datasets for testing and demonstration purposes. These cover multiple languages and transcription systems.
๐บ๐ธ English Datasets
- english.csv - CMU Dictionary subset (ARPABET)
- english_freq.csv - With CELEX frequencies
- english_needle.csv - Needle et al. (2022) dataset
- english_onsets.csv - Hayes & Wilson (2008) onsets
๐ European Languages
- finnish.csv - Finnish orthographic words
- french.csv - French corpus (IPA)
- polish_onsets.csv - Polish onsets
- turkish.csv - Turkish lexicon (IPA)
๐บ๏ธ Other Languages
- samoan.csv - Samoan word list (IPA)
- spanish_stress.csv - Spanish with stress
๐ Usage Tips
- Try english.csv for your first test
- Use english_freq.csv for frequency-weighted metrics
- Different transcription systems available
๐ก Quick Start
To use your own data, simply uncheck "Use built-in demo data" in the Calculator tab and upload your CSV files.
๐ Training File Requirements
- Format: CSV file with no headers
- Column 1: Word list with symbols separated by spaces
Example: "cat" becomes "k รฆ t" in IPA - Column 2 (Optional): Raw frequency counts
Example: "c a t, 42"
๐ฏ Test File Requirements
- Format: Single column CSV
- Same transcription: Match training file
- Space-separated symbols (e.g., "d ษ g" for "dog")
Example: "d ษ g"
โจ Example Formats
Here are examples of correctly formatted data for different languages and transcription systems:
๐ค English with Frequencies
c a t, 42
d o g, 37
f i s h, 18
Training file with orthographic symbols and frequency counts
๐ IPA Transcription
k รฆ t, 42
d ษ g, 37
f ษช ส, 18
Training file using International Phonetic Alphabet
๐ซ๐ฎ Finnish Example
k i s s a
k o i r a
k a l a
Simple word list without frequencies (orthographic)
๐ฏ Test File Example
n e w w o r d
t e s t w o r d
a n o t h e r
Test file with words to score
๐ Additional Help
Need more detailed format info?
Check the About tab for complete formatting specifications and technical details.
๐ Need Help?
- Try the Examples tab for pre-configured demonstrations
- Check the About tab for technical details on the models
- Visit our GitHub repository for more information
๐ฅ๏ธ Multiple Interfaces
- Command-line interface: Run from terminal
- Python API: Integrate with your code
- Web interface: This Gradio UI
๐ง Advanced Features
- Plugin system: Add custom models
- Cross-platform: Windows, macOS, Linux
- Comprehensive docs: Detailed explanations
๐ฆ Install from PyPI (Recommended)
pip install uci-phonotactic-calculator
This installs the latest stable version from the Python Package Index.
โก Install from Source
git clone https://github.com/connormayer/uci_phonotactic_calculator.git
cd uci_phonotactic_calculator
pip install -e .
This installs the development version with latest features.
๐ Ways to Help
Contributions are welcome! Here's how you can help:
๐ Report Issues
Found a bug? Let us know!
- Open detailed bug reports
- Include steps to reproduce
- Share error messages
๐ก Request Features
Have ideas for improvements?
- Suggest new functionality
- Propose UI improvements
- Share use case examples
๐ง Add Plugins
Extend the calculator!
- Create new phonotactic models
- Add custom metrics
- Implement new algorithms
๐ Improve Docs
Help others understand!
- Clarify explanations
- Add examples
- Fix typos and errors
๐ก Quick Start
The simplest way to understand the format is to look at examples on the Datasets tab, or try the demo data!
๐ Training File Format
- Format: Comma-separated (.csv) file with no headers
- Column 1 (Required): Word list with symbols separated by spaces
Example: "cat" becomes "k รฆ t" in IPA - Column 2 (Optional): Raw frequency counts
๐ฏ Test File Format
- Format: Single column CSV
- Same transcription system as training file
- Space-separated symbols (e.g., "d ษ g" for "dog")
๐ข Core Metrics
The calculator provides several types of phonotactic scores:
๐ Unigram Probabilities
uni_prob- Basic unigram probabilityuni_prob_freq_weighted- Frequency-weighteduni_prob_smoothed- Add-one smootheduni_prob_freq_weighted_smoothed- Both variants
๐ Bigram Probabilities
bi_prob- Basic bigram probabilitybi_prob_freq_weighted- Frequency-weightedbi_prob_smoothed- Add-one smoothedbi_prob_freq_weighted_smoothed- Both variants
๐ Positional Unigram Scores
pos_uni_score- Position-sensitive unigrampos_uni_score_freq_weighted- Frequency-weightedpos_uni_score_smoothed- Add-one smoothedpos_uni_score_freq_weighted_smoothed- Both
๐ฏ Positional Bigram Scores
pos_bi_score- Position-sensitive bigrampos_bi_score_freq_weighted- Frequency-weightedpos_bi_score_smoothed- Add-one smoothedpos_bi_score_freq_weighted_smoothed- Both
๐ฌ Metric Variants Explained
- Frequency-weighted: High-frequency words contribute more to probability calculations
- Smoothed: Assigns small probabilities to unseen sound combinations
- Positional: Considers where sounds appear in words (beginning, middle, end)
๐งช Smoothing Method
In the token-weighted versions of the metrics, smoothing is also done by adding one to the log-weighted counts.
๐ References
Vitevitch, M.S., & Luce, P.A. (2004). A web-based interface to calculate phonotactic probability for words and nonwords in English. Behavior Research Methods, Instruments, & Computers, 36(3), 481-487.
๐ Citation & Links
If you use this tool in your research, please cite:
Mayer, C., Kondur, A., & Sundara, M. (2022). UCI Phonotactic Calculator (Version 0.1.0) [Computer software]. https://doi.org/10.5281/zenodo.7443706
๐ GitHub Repository | ๐ง Report Issues
๐ Step 1: Choose Your Data
- Upload your own files: Use CSV files with a 'word' column
- Try the demo: Click "Load Demo Data" for sample English words
โ๏ธ Step 3: Configure Settings
- N-gram Order: How many characters to consider (2-4 recommended)
- Advanced Options: Fine-tune probability calculations
๐ง Step 2: Select a Model
- N-gram Model: Classic phonotactic probability
- Positional N-gram: Position-aware analysis (more sophisticated)
๐ Step 4: Calculate & Download
- Click "Calculate Phonotactic Scores" to process your data
- View results in the preview table
- Download the complete scored dataset as CSV
๐ Score Interpretation
The tool adds phonotactic probability scores to each word in your test data:
- Higher scores = more phonotactically probable (sounds more "natural")
- Lower scores = less phonotactically probable (sounds more unusual)
Score Types Available:
- Raw Probability: Direct statistical probability
- Log Probability: Natural logarithm (useful for very small numbers)
- Z-score: Standardized score comparing to the dataset average
- Training Data: Use a large, representative sample of your language
- Test Data: Can be real words, made-up words, or mixed datasets
- N-gram Order: Start with 2-3 for most languages, try 4 for detailed analysis
- File Format: Ensure your CSV has a 'word' column with one word per row
Phonotactic probability measures how "word-like" a sequence of sounds is in a particular language. It's based on:
- How often sound combinations appear in real words
- Position-specific patterns (some sounds are more common at word beginnings vs. endings)
- Statistical modeling of large word databases
This is useful for linguistics research, psycholinguistics experiments, and understanding sound patterns across languages.
- Linguistics Research: Analyze cross-linguistic sound patterns
- Psychology Experiments: Create stimuli with controlled phonotactic properties
- Language Learning: Understand which word combinations sound natural
- Computational Linguistics: Feature engineering for NLP models
๐ Need Help?
- Try the Examples tab for pre-configured demonstrations
- Check the About tab for technical details on the models
- Visit our GitHub repository for more information