Spaces:
Running
Running
File size: 4,722 Bytes
e428629 23c6c15 b5c0331 23c6c15 b5c0331 23c6c15 e428629 b5c0331 23c6c15 b5c0331 23c6c15 b5c0331 23c6c15 b5c0331 23c6c15 b5c0331 23c6c15 b5c0331 23c6c15 b5c0331 23c6c15 b5c0331 2492bf1 3b42d2e a7227ea c383805 8f0386e 9a78347 345f9b9 7ebc2a4 108818e 2c4db13 0976862 e2f04e6 0144efe a52ad08 e3514b5 f88ffe9 9cb271c c9d118e 26d4d60 df672bd 9b5d48d a6f301f ba8d30d 99a5942 2492bf1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
---
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 π
- Enhanced top-K slider functionality. βοΈ - June 21, 2025 π
- Added support for multiple [MASK] tokens. π - June 20, 2025 π
- Improved DistilRoBERTa prediction speed. - June 19, 2025 π
- Updated Gradio UI to version 5.31.0 for enhanced performance. π - June 18, 2025 π
- Optimized CPU inference for larger inputs. - June 17, 2025 π
- Enhanced top-K slider functionality. - June 16, 2025 π
- Added support for multiple [MASK] tokens. - June 15, 2025 π
- Improved DistilRoBERTa prediction speed. βοΈ - June 14, 2025 π
- Updated Gradio UI to version 5.31.0 for enhanced performance. - June 13, 2025 π
- Optimized CPU inference for larger inputs. - June 12, 2025 π
- Enhanced top-K slider functionality. π§ - June 11, 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 |