https://github.com/trisdeveloper/ai-word-predictor
An AI model to predict the missing words in a text sequence.
https://github.com/trisdeveloper/ai-word-predictor
ai bert gradio huggingface language-model machine-learning python tensorflow tranformers
Last synced: about 2 months ago
JSON representation
An AI model to predict the missing words in a text sequence.
- Host: GitHub
- URL: https://github.com/trisdeveloper/ai-word-predictor
- Owner: trisDeveloper
- Created: 2024-10-18T14:31:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-06T19:39:57.000Z (over 1 year ago)
- Last Synced: 2025-01-13T05:25:52.009Z (over 1 year ago)
- Topics: ai, bert, gradio, huggingface, language-model, machine-learning, python, tensorflow, tranformers
- Language: Python
- Homepage: https://huggingface.co/spaces/tris-dev/word-predictor
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
title: Word Predictor
emoji: ๐ข
colorFrom: yellow
colorTo: pink
sdk: gradio
sdk_version: 5.5.0
app_file: app.py
pinned: false
license: mit
short_description: AI Masked Word Prediction Tool
---
# ๐ Masked Word Prediction Tool
A web tool that predicts missing words in sentences, using BERT to handle multiple masked words at once. Simply type your sentence with masked words (as `_`) and get accurate predictions in real-time.
[](https://www.tensorflow.org/)
[](https://huggingface.co/transformers/)
[](https://gradio.app/)
[](https://huggingface.co/)
[](https://www.python.org/)
[](https://numpy.org/)
[](https://pandas.pydata.org/)
[](https://keras.io/)
## ๐ฏ Features
- Predicts single or multiple masked words in a sentence.
- Fast predictions (0.3 to 1.8 seconds) using optimized BERT-based masked language modeling.
- User-friendly interface with customizable masked word token (`_` by default).
## ๐ How It Works
The app leverages **BERT** for masked language modeling, using Hugging Face's `transformers` library for powerful NLP capabilities. Hereโs how it handles predictions:
1. Replaces any `_` in the input text with the BERT `[MASK]` token.
2. Processes each `[MASK]` position in the sentence individually to predict likely words.
## ๐ฅ Try It Out
[Launch the App on Hugging Face Spaces](https://huggingface.co/spaces/tris-dev/word-predictor)
### Example Usage
Type in a sentence with `_` for masked words:
> _ order to achieve our goals, we need to focus on _ strategies that will improve our teamโs _ and use our resources _.
The model might predict:
> **In** order to achieve our goals, we need to focus on **developing** strategies that will improve our teamโs **performance** and use our resources **effectively**.
## โก Performance
Thanks to optimization efforts, the app responds quickly, averaging between **0.3** to **1.8 seconds** per prediction depending on the input length.
## ๐ ๏ธ Installation (For Local Use)
1. Clone the repository and install dependencies to get started locally.
```bash
git clone https://github.com/trisDeveloper/AI-Word-Predictor
cd AI-Word-Predictor
pip install -r requirements.txt
```
2. Run the app with: `python app.py`
### ๐ License
MIT License