Update README.md
Browse files
README.md
CHANGED
|
@@ -1,62 +1,48 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
-
#
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|---|---|
|
| 11 |
-
| `app.py` | Gradio UI — layout, toolbar, live callbacks |
|
| 12 |
-
| `nlp_pipeline.py` | All NLP logic |
|
| 13 |
-
| `config.py` | All tuneable settings |
|
| 14 |
-
| `requirements.txt` | Python dependencies |
|
| 15 |
-
|
| 16 |
-
---
|
| 17 |
|
| 18 |
## Features
|
| 19 |
|
| 20 |
-
- **Grammar mode** — spelling correction
|
| 21 |
-
- **Paraphrase mode** — rewrites in Neutral / Formal / Casual / Student essay / Technical style
|
| 22 |
- **Both** — grammar first, then paraphrase the cleaned result
|
| 23 |
-
- **Diff highlighting** — red strikethrough for removed tokens, green
|
| 24 |
-
- **
|
| 25 |
-
- **
|
| 26 |
-
|
| 27 |
-
---
|
| 28 |
-
|
| 29 |
-
## Models used
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|---|---|---|
|
| 33 |
-
| Grammar error correction | `prithivida/grammar_error_correcter_v1` | Fine-tuned on GEC benchmarks; far better than raw `t5-small` with `"grammar:"` prefix |
|
| 34 |
-
| Paraphrasing | `Vamsi/T5_Paraphrase_Paws` | Fine-tuned on PAWS paraphrase pairs |
|
| 35 |
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
## Running locally
|
| 41 |
|
| 42 |
```bash
|
| 43 |
python -m venv .venv
|
| 44 |
-
source .venv/bin/activate
|
| 45 |
pip install -r requirements.txt
|
| 46 |
python app.py
|
| 47 |
# → http://127.0.0.1:7860
|
| 48 |
```
|
| 49 |
|
| 50 |
-
First run will download the models (~300 MB total). Subsequent runs use the local cache.
|
| 51 |
-
|
| 52 |
-
---
|
| 53 |
-
|
| 54 |
-
## Running on Hugging Face Spaces
|
| 55 |
-
|
| 56 |
-
Create a **Gradio** Space and push all four files. The `app.py` entrypoint is auto-detected. GPU hardware is recommended for faster inference but not required.
|
| 57 |
-
|
| 58 |
-
---
|
| 59 |
-
|
| 60 |
## Tuning
|
| 61 |
|
| 62 |
- **Grammar rules** — edit `CUSTOM_GRAMMAR_RULES` in `config.py`
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: AI-Aware Writing Assistant
|
| 3 |
+
emoji: ✍️
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: "4.0.0"
|
| 8 |
+
python_version: "3.10"
|
| 9 |
+
app_file: app.py
|
| 10 |
+
pinned: false
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# ✍️ AI-Aware Writing Assistant
|
| 14 |
|
| 15 |
+
A hybrid NLP + Transformer writing assistant. Fixes grammar and spelling, paraphrases in multiple styles, and shows optional text statistics.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
## Features
|
| 18 |
|
| 19 |
+
- **Grammar mode** — spelling correction → regex rules → neural GEC model (per-sentence, no truncation)
|
| 20 |
+
- **Paraphrase mode** — rewrites in Neutral / Formal / Casual / Student essay / Technical style with synonym replacement and sentence-length variation
|
| 21 |
- **Both** — grammar first, then paraphrase the cleaned result
|
| 22 |
+
- **Diff highlighting** — red strikethrough for removed tokens, green underline for added tokens
|
| 23 |
+
- **Dark / Light mode** — toggle in the header, preference saved across sessions
|
| 24 |
+
- **Copy result** — one click to copy the accepted version to clipboard
|
| 25 |
+
- **Text statistics** — word count, sentence count, Flesch readability, burstiness
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
## Models
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
| Task | Model |
|
| 30 |
+
|---|---|
|
| 31 |
+
| Grammar correction | `vennify/t5-base-grammar-correction` (fallback: `prithivida/grammar_error_correcter_v1`) |
|
| 32 |
+
| Paraphrasing | `Vamsi/T5_Paraphrase_Paws` |
|
| 33 |
|
| 34 |
+
Both models fall back gracefully if unavailable.
|
| 35 |
|
| 36 |
## Running locally
|
| 37 |
|
| 38 |
```bash
|
| 39 |
python -m venv .venv
|
| 40 |
+
source .venv/bin/activate
|
| 41 |
pip install -r requirements.txt
|
| 42 |
python app.py
|
| 43 |
# → http://127.0.0.1:7860
|
| 44 |
```
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
## Tuning
|
| 47 |
|
| 48 |
- **Grammar rules** — edit `CUSTOM_GRAMMAR_RULES` in `config.py`
|