This repository contains the code for a Next Word Prediction application. The application predicts the next word in a given text sequence using n-grams analysis. The frontend is a simple web interface built with HTML and Tailwind CSS, and the backend is a FastAPI server that handles text prediction requests.
- Predicts the next word based on the input text.
- Offers a simple and interactive web interface.
- Utilizes FastAPI for efficient backend processing.
- Supports different data sources for predictions.
- Python 3.8+
- Pipenv
- Node.js (optional, for frontend modifications)
- Clone the repository:
git clone https://github.com/iboraham/next-word-prediction.git
- Navigate to the backend directory and install dependencies:
cd backend pipenv install
- Start the FastAPI server:
pipenv run uvicorn app:app --reload
Open the index.html
file in a web browser to access the Next Word Prediction application. Ensure the backend server is running for the prediction functionality to work.
Optionally, you can run the frontend in development mode to make changes to the UI. To do so:
npx serve .
Refer to ./backend/README.md
for detailed API documentation.
To run the tests, navigate to the backend directory and execute:
pipenv run pytest
Contributions are welcome! If you have suggestions or want to contribute to the project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes and push to your fork.
- Create a pull request against the main repository.
Created by Onur Serbetci