Spaces:
Running
Running
metadata
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
π 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
- Open the demo at
https://huggingface.co/spaces/ghostai1/Masked-Word-Predictor
- In the Input Sentence field, type a sentence with exactly one
[MASK]
token.- Example:
βShe bought a new [MASK] at the salon.β
- Example:
- Set Top K Predictions via the slider (default = 5).
- Click Predict π·οΈ.
- View the Predictions table: each row shows the completed sentence and its confidence.
π οΈ Local Development
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