Spaces:
Sleeping
Sleeping
Commit History
-
Update app.py
Verified signature67276fb -
Create app.py
Verified signatureThis application implements an N-Gram based autocomplete system using a simple training and prediction mechanism. It is designed to be deployed on Hugging Face Spaces with Gradio, which provides a user-friendly web interface. Overall Workflow: ----------------- 1. **Training Phase:** - Users provide training sentences via the "Train" tab. - Each training sentence is split into words. - The app builds a list of three-word groups (trigrams) from the sentences. - For each trigram, the first two words act as the "context" (or key) and the third word is the predicted continuation. The app maintains: • A `pair_dict` list containing all unique trigrams. • A `freq` list holding the frequency count corresponding to each trigram. - Training stops either when all sentences are processed or when a sentence equals "stop the training". 2. **Prediction (Autocompletion) Phase:** - Users provide a starting text (at least two words) and specify the number of w…75deb62 -
initial commit
Verified signature733b4d6