ghostai1's picture
Update README.md
b5c0331 verified
|
raw
history blame
2.35 kB
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

Hugging Face Space
[Gradio UI]
Model
License


πŸš€ Overview

Tap into Masked Language Modeling with DistilRoBERTaβ€”no training required.
Type a sentence containing the special [MASK] token and get the model’s top-K completions instantly, all on free CPU.

Key AI concepts:
β€’ Masked Language Modeling (MLM) β€’ Transformer-based NLP β€’ Distilled Architectures β€’ Real-time Inference β€’ Edge Deployment β€’ Cloud-native Demo


✨ Features

πŸ”‘ Feature πŸ” Why It’s Cool
🧠 Transformer MLM Uses DistilRoBERTa for lightning-fast fills
⚑ CPU-Only Inference Runs on free-tier Space (2 vCPU / 16 GB RAM)
πŸ”’ Top-K Control Slider to choose how many predictions to show
🎨 Interactive UI Gradio Blocks: input, button, and DataFrame
πŸ”§ Zero-Config Deploy Commit three filesβ€”Spaces auto-builds
πŸ’‘ Educational Demos Great for teaching how MLM works

πŸ—οΈ How It Works

  1. User Input – Sentence with one or more [MASK] tokens.
  2. MLM Pipeline – pipeline("fill-mask") computes token-level likelihoods.
  3. Ranking – Returns the top-K predicted tokens with scores.
  4. UI Rendering – Gradio shows each filled sentence and its confidence.

πŸ› οΈ Local Development

git clone https://github.com/your-username/masked-word-predictor.git
cd masked-word-predictor
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python app.py