Spaces:
Running
Running
title: Masked Word Predictor | |
emoji: π | |
colorFrom: green | |
colorTo: indigo | |
sdk: gradio | |
sdk_version: 5.31.0 | |
app_file: app.py | |
pinned: false | |
license: apache-2.0 | |
short_description: Masked Word Predicto CPU | |
# π Masked Word Predictor | |
[](https://huggingface.co/spaces/ghostai1/Masked-Word-Predictor) | |
[] | |
[](https://huggingface.co/distilroberta-base) | |
[](LICENSE) | |
--- | |
## π Live Demo | |
Try it out here: | |
π **https://huggingface.co/spaces/ghostai1/Masked-Word-Predictor** | |
--- | |
## π What It Does | |
The **Masked Word Predictor** uses a pre-trained DistilRoBERTa model to perform **masked language modeling** in real timeβ100 % CPU, zero infra. | |
Type any sentence containing the special token `[MASK]` and get the modelβs **top-K** fill-in predictions, complete with confidence scores. | |
> Example use case: | |
> > Input: | |
> > βThe new conditioner made my hair feel [MASK].β | |
> > | |
> > Output: | |
> > | sequence | score | | |
> > |--------------------------------------------|--------| | |
> > | βThe new conditioner made my hair feel soft.β | 0.987 | | |
> > | βThe new conditioner made my hair feel smooth.β | 0.923 | | |
> > β¦ | |
--- | |
## β¨ Key Features | |
| π Feature | π Description | | |
|--------------------------|------------------------------------------------------------------| | |
| **π§ Transformer MLM** | DistilRoBERTa fill-mask pipeline for lightning-fast predictions | | |
| **βοΈ Top-K Control** | Slider to choose how many completions youβd like (1β10) | | |
| **π» CPU-Only Inference** | Runs on free 2 vCPU/16 GB RAM Spacesβno GPU needed | | |
| **π¨ Interactive UI** | Gradio Blocks with clear input, button, and results table | | |
| **π§ Zero-Config Deploy** | Drop in three files; Spaces auto-builds & hosts your demo | | |
--- | |
## π¨ How to Use | |
1. **Open the demo** at | |
`https://huggingface.co/spaces/ghostai1/Masked-Word-Predictor` | |
2. In the **Input Sentence** field, type a sentence with exactly one `[MASK]` token. | |
- Example: `βShe bought a new [MASK] at the salon.β` | |
3. Set **Top K Predictions** via the slider (default = 5). | |
4. Click **Predict π·οΈ**. | |
5. View the **Predictions** table: each row shows the completed sentence and its confidence. | |
--- | |
## π οΈ Local Development | |
```bash | |
git clone https://github.com/ghostai1/Masked-Word-Predictor.git | |
cd Masked-Word-Predictor | |
python3 -m venv venv && source venv/bin/activate | |
pip install -r requirements.txt | |
python app.py | |
## Latest Update | |
- Updated Gradio UI to version 5.31.0 for enhanced performance. π - May 29, 2025 π | |
- Added support for multiple [MASK] tokens. - June 10, 2025 π | |
- Improved DistilRoBERTa prediction speed. π - June 09, 2025 π | |
- Updated Gradio UI to version 5.31.0 for enhanced performance. π - June 08, 2025 π | |
- Optimized CPU inference for larger inputs. π - June 07, 2025 π | |
- Enhanced top-K slider functionality. βοΈ - June 06, 2025 π | |
- Added support for multiple [MASK] tokens. π - June 05, 2025 π | |
- Improved DistilRoBERTa prediction speed. π§ - June 04, 2025 π | |
- Updated Gradio UI to version 5.31.0 for enhanced performance. π - June 03, 2025 π | |
- Optimized CPU inference for larger inputs. π§ - June 02, 2025 π | |
- Enhanced top-K slider functionality. - June 01, 2025 π | |
- Added support for multiple [MASK] tokens. π - May 31, 2025 π | |
- Improved DistilRoBERTa prediction speed. βοΈ - May 30, 2025 π | |
**Website**: https://ghostainews.com/ | |
**Discord**: https://discord.gg/BfA23aYz |