ghostai1 commited on
Commit
23c6c15
Β·
verified Β·
1 Parent(s): b5c0331

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +40 -23
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
- [![Hugging Face Space](https://img.shields.io/badge/HuggingFace-Spaces-blue?logo=huggingface)](https://huggingface.co/spaces/your-username/masked-word-predictor)
15
  [![Gradio UI](https://img.shields.io/badge/Gradio-5.31.0-green?logo=gradio)]
16
  [![Model](https://img.shields.io/badge/Model-distilroberta--base-orange)](https://huggingface.co/distilroberta-base)
17
- [![License](https://img.shields.io/badge/License-MIT-lightgrey)](LICENSE)
 
 
 
 
 
 
18
 
19
  ---
20
 
21
- ## πŸš€ Overview
22
- Tap into **Masked Language Modeling** with **DistilRoBERTa**β€”no training required.
23
- Type a sentence containing the special `[MASK]` token and get the model’s **top-K** completions instantly, all on **free CPU**.
24
 
25
- > **Key AI concepts:**
26
- > β€’ Masked Language Modeling (MLM) β€’ Transformer-based NLP β€’ Distilled Architectures β€’ Real-time Inference β€’ Edge Deployment β€’ Cloud-native Demo
 
 
 
 
 
 
 
 
27
 
28
  ---
29
 
30
- ## ✨ Features
31
 
32
- | πŸ”‘ Feature | πŸ” Why It’s Cool |
33
- |----------------------------|----------------------------------------------|
34
- | **🧠 Transformer MLM** | Uses DistilRoBERTa for lightning-fast fills |
35
- | **⚑ CPU-Only Inference** | Runs on free-tier Space (2 vCPU / 16 GB RAM) |
36
- | **πŸ”’ Top-K Control** | Slider to choose how many predictions to show |
37
- | **🎨 Interactive UI** | Gradio Blocks: input, button, and DataFrame |
38
- | **πŸ”§ Zero-Config Deploy** | Commit three filesβ€”Spaces auto-builds |
39
- | **πŸ’‘ Educational Demos** | Great for teaching how MLM works |
40
 
41
  ---
42
 
43
- ## πŸ—οΈ How It Works
44
 
45
- 1. **User Input** – Sentence with one or more `[MASK]` tokens.
46
- 2. **MLM Pipeline** – `pipeline("fill-mask")` computes token-level likelihoods.
47
- 3. **Ranking** – Returns the top-K predicted tokens with scores.
48
- 4. **UI Rendering** – Gradio shows each filled sentence and its confidence.
 
 
 
49
 
50
  ---
51
 
52
  ## πŸ› οΈ Local Development
53
 
54
  ```bash
55
- git clone https://github.com/your-username/masked-word-predictor.git
56
- cd masked-word-predictor
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
+ [![Hugging Face Space](https://img.shields.io/badge/HuggingFace-Spaces-blue?logo=huggingface)](https://huggingface.co/spaces/ghostai1/Masked-Word-Predictor)
16
  [![Gradio UI](https://img.shields.io/badge/Gradio-5.31.0-green?logo=gradio)]
17
  [![Model](https://img.shields.io/badge/Model-distilroberta--base-orange)](https://huggingface.co/distilroberta-base)
18
+ [![License-MIT](https://img.shields.io/badge/License-MIT-lightgrey)](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