Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
@@ -10,50 +10,67 @@ pinned: false
|
|
10 |
license: apache-2.0
|
11 |
short_description: Masked Word Predicto CPU
|
12 |
---
|
|
|
13 |
# π Masked Word Predictor
|
14 |
-
[](https://huggingface.co/spaces/
|
15 |
[]
|
16 |
[](https://huggingface.co/distilroberta-base)
|
17 |
-
[](LICENSE)
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
---
|
20 |
|
21 |
-
##
|
22 |
-
|
23 |
-
Type
|
24 |
|
25 |
-
>
|
26 |
-
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
---
|
29 |
|
30 |
-
## β¨ Features
|
31 |
|
32 |
-
| π Feature
|
33 |
-
|
34 |
-
| **π§ Transformer MLM**
|
35 |
-
|
|
36 |
-
|
|
37 |
-
| **π¨ Interactive UI**
|
38 |
-
| **π§ Zero-Config Deploy**
|
39 |
-
| **π‘ Educational Demos** | Great for teaching how MLM works |
|
40 |
|
41 |
---
|
42 |
|
43 |
-
##
|
44 |
|
45 |
-
1. **
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
49 |
|
50 |
---
|
51 |
|
52 |
## π οΈ Local Development
|
53 |
|
54 |
```bash
|
55 |
-
git clone https://github.com/
|
56 |
-
cd
|
57 |
python3 -m venv venv && source venv/bin/activate
|
58 |
pip install -r requirements.txt
|
59 |
python app.py
|
|
|
10 |
license: apache-2.0
|
11 |
short_description: Masked Word Predicto CPU
|
12 |
---
|
13 |
+
|
14 |
# π Masked Word Predictor
|
15 |
+
[](https://huggingface.co/spaces/ghostai1/Masked-Word-Predictor)
|
16 |
[]
|
17 |
[](https://huggingface.co/distilroberta-base)
|
18 |
+
[](LICENSE)
|
19 |
+
|
20 |
+
---
|
21 |
+
|
22 |
+
## π Live Demo
|
23 |
+
Try it out here:
|
24 |
+
π **https://huggingface.co/spaces/ghostai1/Masked-Word-Predictor**
|
25 |
|
26 |
---
|
27 |
|
28 |
+
## π What It Does
|
29 |
+
The **Masked Word Predictor** uses a pre-trained DistilRoBERTa model to perform **masked language modeling** in real timeβ100 % CPU, zero infra.
|
30 |
+
Type any sentence containing the special token `[MASK]` and get the modelβs **top-K** fill-in predictions, complete with confidence scores.
|
31 |
|
32 |
+
> Example use case:
|
33 |
+
> > Input:
|
34 |
+
> > βThe new conditioner made my hair feel [MASK].β
|
35 |
+
> >
|
36 |
+
> > Output:
|
37 |
+
> > | sequence | score |
|
38 |
+
> > |--------------------------------------------|--------|
|
39 |
+
> > | βThe new conditioner made my hair feel soft.β | 0.987 |
|
40 |
+
> > | βThe new conditioner made my hair feel smooth.β | 0.923 |
|
41 |
+
> > β¦
|
42 |
|
43 |
---
|
44 |
|
45 |
+
## β¨ Key Features
|
46 |
|
47 |
+
| π Feature | π Description |
|
48 |
+
|--------------------------|------------------------------------------------------------------|
|
49 |
+
| **π§ Transformer MLM** | DistilRoBERTa fill-mask pipeline for lightning-fast predictions |
|
50 |
+
| **βοΈ Top-K Control** | Slider to choose how many completions youβd like (1β10) |
|
51 |
+
| **π» CPU-Only Inference** | Runs on free 2 vCPU/16 GB RAM Spacesβno GPU needed |
|
52 |
+
| **π¨ Interactive UI** | Gradio Blocks with clear input, button, and results table |
|
53 |
+
| **π§ Zero-Config Deploy** | Drop in three files; Spaces auto-builds & hosts your demo |
|
|
|
54 |
|
55 |
---
|
56 |
|
57 |
+
## π¨ How to Use
|
58 |
|
59 |
+
1. **Open the demo** at
|
60 |
+
`https://huggingface.co/spaces/ghostai1/Masked-Word-Predictor`
|
61 |
+
2. In the **Input Sentence** field, type a sentence with exactly one `[MASK]` token.
|
62 |
+
- Example: `βShe bought a new [MASK] at the salon.β`
|
63 |
+
3. Set **Top K Predictions** via the slider (default = 5).
|
64 |
+
4. Click **Predict π·οΈ**.
|
65 |
+
5. View the **Predictions** table: each row shows the completed sentence and its confidence.
|
66 |
|
67 |
---
|
68 |
|
69 |
## π οΈ Local Development
|
70 |
|
71 |
```bash
|
72 |
+
git clone https://github.com/ghostai1/Masked-Word-Predictor.git
|
73 |
+
cd Masked-Word-Predictor
|
74 |
python3 -m venv venv && source venv/bin/activate
|
75 |
pip install -r requirements.txt
|
76 |
python app.py
|