You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
Prosodic is a metrical-phonological parser written in Python. Currently, it can parse English and Finnish text, but adding additional languages is easy with a pronunciation dictionary or a custom python function. Prosodic was built by [Ryan Heuser](https://github.com/quadrismegistus), [Josh Falk](https://github.com/jsfalk), and [Arto Anttila](http://web.stanford.edu/~anttila/). Josh also maintains [another repository](https://github.com/jsfalk/prosodic1b), in which he has rewritten the part of this project that does phonetic transcription for English and Finnish. [Sam Bowman](https://github.com/sleepinyourhat) has contributed to the codebase as well, adding several new metrical constraints.
6
6
7
-
This version, Prosodic 2.x, is a near-total rewrite of the original Prosodic.
7
+
Prosodic 3.x features a DataFrame-first architecture with vectorized numpy constraint evaluation, GPU-accelerated harmonic bounding, and a Maximum Entropy weight learner for training constraint weights from annotated data. See [CLAUDE.md](CLAUDE.md) for full architecture docs.
8
8
9
9
Supports Python>=3.9.
10
10
@@ -13,6 +13,20 @@ Supports Python>=3.9.
13
13
You can view and use a web app demo of the current Prosodic app at **[prosodic.dev](https://prosodic.dev/)**.
14
14
15
15
16
+
## Performance
17
+
18
+
Shakespeare sonnets (2155 lines, Apple M1). Run `python -m prosodic.profiling` to regenerate.
|**DF-only (no entities, GPU)**|**78.3s**|**1.8s**|**42x**|
28
+
| Syntax (dep parse) | 160.2s | 2.7s | 58x |
29
+
16
30
## Install
17
31
18
32
### 1. Install python package
@@ -851,6 +865,44 @@ line_from_richardIII
851
865
852
866
853
867
868
+
#### Phrasal stress (syntax)
869
+
870
+
Prosodic can optionally compute phrasal stress from dependency parsing (Liberman & Prince 1977), using spaCy. This adds a `phrasal_stress` column to the syllable DataFrame, indicating each word's syntactic prominence (0 = sentence root, more negative = more deeply embedded).
871
+
872
+
```bash
873
+
# Install spaCy (optional dependency)
874
+
pip install prosodic[syntax]
875
+
python -m spacy download en_core_web_sm
876
+
```
877
+
878
+
```python
879
+
# Enable with syntax=True
880
+
t = prosodic.Text("Shall I compare thee to a summers day", syntax=True)
0 commit comments