Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sheel-ui/next-word-backend
https://github.com/sheel-ui/next-word-backend
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sheel-ui/next-word-backend
- Owner: Sheel-ui
- Created: 2024-03-18T00:19:32.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-05-19T15:04:32.000Z (8 months ago)
- Last Synced: 2024-05-19T16:25:29.921Z (8 months ago)
- Language: Python
- Size: 254 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next Word Prediction
The "Next Word Prediction" project is a sophisticated text auto-completion system designed to anticipate the following sequence of words as users type. The cutting-edge [bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased) model by Hugging Face is used in backend. With applications spanning various fields, from messaging platforms to document creation tools, this project enhances user experience by seamlessly providing predictive suggestions in any textbox.### Features
-
**Flexible model selection:** Users can opt for different models to suit their needs and preferences, ensuring optimal prediction accuracy.
- **Personalized prediction display:** Adjustable settings empower users to specify the number of predictions shown on their interface, enhancing convenience and usability.
- **Tailored token prediction:** Users can customize the number of consecutive tokens predicted, enabling fine-tuning of prediction granularity for diverse applications.
- **Temperature parameter adjustment:** Control over the temperature parameter allows users to balance prediction randomness, providing a balance between creativity and probability in suggested text sequences.
# Getting StartedTo get started with Next Word Prediction, follow these steps:
### API Setup
1. Make sure you have Python installed on your system.
2. Create a new conda environment. Install the required dependencies by running the following commands:```bash
$ conda create -n env
$ conda activate
$ pip install -r requirements.txt
```
3. Start the API service by running the `app.py` file:
```bash
$ python app.py
```To enable frontend functionality, a separate service needs to be initiated.GitHub repository for the frontend - [next-word-frontend](https://github.com/Sheel-ui/next-word-frontend).
# Changing env variables and Models### API
1. You can find a `.env` file in the api directory. Open the file using the following command
```bash
$ vi api/.env
```
2. You can change `HOST`, `PORT` or the `ENDPOINT` of the flask service here.#### Changing Models
The `.env` file contain variable MODEL that point to the Hugging Face language model bert-base-uncased. By modifying this variable, you can switch to different models.# Demo
![Alt Text](./demo/demo.gif)