galafis/Text-Generation-API
Professional project by Gabriel Demetrios Lafis
What's novel
Professional project by Gabriel Demetrios Lafis
Code Analysis
4 files read · 2 roundsA Flask REST API that generates text using a Markov chain (order-2 transition table) and an n-gram language model (order-3 with temperature sampling), both trained on a small built-in corpus or user-supplied text.
Strengths
Clean separation between model classes and API routes, with genuine (if simple) implementations of both statistical models. Tests cover both model logic and API endpoints including error cases and reproducibility.
Weaknesses
No thread safety for the global model singletons, no actual Laplace smoothing despite the docstring claim, and the Markov chain's start_tokens list grows unboundedly with repeated training. The implementations are textbook-level and lack production hardening (input validation gaps, no negative-length checks, string-based random seed).
Score Breakdown
Signal breakdown
Innovation
Craft
Traction
Scope
Evidence
Commits
10
Contributors
1
Files
8
Active weeks
3
Repository
Language
Python
Stars
1
Forks
0
License
MIT