Skip to content

trisDeveloper/AI-Word-Predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

title emoji colorFrom colorTo sdk sdk_version app_file pinned license short_description
Word Predictor
🐢
yellow
pink
gradio
5.5.0
app.py
false
mit
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.

TensorFlow Transformers Gradio Hugging Face Python NumPy Pandas Keras

🎯 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

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.
git clone https://github.com/trisDeveloper/AI-Word-Predictor
cd AI-Word-Predictor
pip install -r requirements.txt
  1. Run the app with: python app.py

📄 License

MIT License