MaxEnt with Hidden Structure in R
Overview
This is an interactive Shiny application designed to help linguists generate phonological grammars (weights) using a Maximum Entropy model. The app is built on top of the HGR model developed by Staubs (2011). HGR finds solutions for learning problems (with or without hidden structure), generates distributions over forms, and performs online learning simulations.
User Guide
Input file format
The input file should be a CSV or TXT file with the following columns:
input— input formsoutput— output formsprobability— observed probabilities or raw frequencies- Additional columns, one per constraint.
Using the Shiny app
- Upload your data file. Use the "Choose Input File" button to upload a CSV or TXT file.
- Select input type. Choose between "Probabilities" and "Raw Frequencies".
- Select prior type. Choose between
L2andL1. - Generate grammar. Click "Generate Grammar" to produce the grammar.
- Edit constraint weights. If needed, adjust weights in the dynamic UI and click "Update Grammar" to recalculate probabilities and errors.
- Download outputs. Use the "Download Output" button to save the generated tableau.
Sample input files
The Shiny app includes three sample input files, available here. They illustrate different scenarios — with and without hidden structure, and candidates supplied as raw frequencies rather than normalized probabilities. These files can be uploaded directly into the app.
Citations
- Staubs, Robert. 2011. Harmonic Grammar in R (hgR). Software/Corpora package. Amherst, MA: University of Massachusetts Amherst. github.com/rstaubs/maxent-hidden-structure
- Nirheche, Ali. 2024. Shiny App for MaxEnt with Hidden Structure. Shiny application. Amherst, MA: University of Massachusetts Amherst. alingwist.shinyapps.io/HGR_app
Acknowledgments
This research was supported by the National Science Foundation grant BCS-2140826 to the University of Massachusetts Amherst.