https://github.com/sharpbit/autocomplete
A simple autocompletion system that uses the Brown University corpus to generate suggestions.
https://github.com/sharpbit/autocomplete
Last synced: 10 months ago
JSON representation
A simple autocompletion system that uses the Brown University corpus to generate suggestions.
- Host: GitHub
- URL: https://github.com/sharpbit/autocomplete
- Owner: SharpBit
- Created: 2021-01-10T16:42:51.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-10T17:00:24.000Z (about 5 years ago)
- Last Synced: 2025-02-08T13:41:59.584Z (12 months ago)
- Language: Python
- Homepage:
- Size: 3.88 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Autocomplete
- A simple autocompletion system that uses the Brown University corpus to generate suggestions.
### Install Dependencies
- Install Python 3.7 (add to PATH)
- Run `pip3 install -r requirements.txt`
- Run `py -3 download_nltk_packages.py`
### Setup
1. Run `py -3 create_unigrams.py` to process the Brown University corpus.
2. Run `py -3 important_unigrams.py` add the most important unigrams to the suggestions.
3. Run `py -3 important_bigrams.py` then `py -3 important_trigrams.py` to do the same for bigrams and trigrams.
4. Run `py -3 create_trie.py` to create the trie of suggestions.
5. Run `py -3 predict_text.py` to open a tkinter window to try it out.
### How to Use
Type in something and press tab to use a suggestion. You might need to type something specific to the Brown University corpus since the variety of documents is limited.
### Example

### Directories
- `/data` Where the processed corpus data is saved
- `/graphs` Images of the graphs created by `important_unigrams.py`, `important_bigrams.py`, and `important_trigrams.py`