joshualoehr/ngram-language-model

Python implementation of an N-gram language model with Laplace smoothing and sentence generation.

37
/ 100
Emerging

Builds N-gram models with configurable smoothing (Laplace with adjustable lambda) and computes perplexity scores on test sets. The implementation prioritizes transparency by hand-coding core algorithms beyond NLTK's `ngrams` and `FreqDist`, while generating sentences with cumulative probability scores. Expects pre-tokenized, sentence-segmented input and provides a CLI for specifying model order, smoothing parameters, and generation count.

No commits in the last 6 months.

No License Stale 6m No Package No Dependents
Maintenance 0 / 25
Adoption 9 / 25
Maturity 8 / 25
Community 20 / 25

How are scores calculated?

Stars

88

Forks

27

Language

Python

License

Last pushed

Feb 09, 2018

Commits (30d)

0

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/nlp/joshualoehr/ngram-language-model"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.