hephaestusonfire commited on
Commit
a390d6a
·
verified ·
1 Parent(s): 9ba5a9c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +25 -39
README.md CHANGED
@@ -1,62 +1,48 @@
1
- # 📝 AI-Aware Writing Assistant
2
-
3
- A hybrid NLP + Transformer writing assistant with a Docs-meets-Grammarly UI. Fixes grammar and spelling, paraphrases in multiple styles, and shows optional text statistics.
4
-
 
 
 
 
 
 
5
  ---
6
 
7
- ## What's inside
8
 
9
- | File | Purpose |
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 (custom rules + edit-distance) → regex grammar rules → neural GEC model
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 dotted-underline for added tokens (like Track Changes)
24
- - **Text statistics** — word count, sentence count, avg sentence length, Flesch readability, burstiness
25
- - **Apply / Clear** — one click to copy the accepted version back into the editor
26
-
27
- ---
28
-
29
- ## Models used
30
 
31
- | Task | Model | Why |
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
- Both models fall back gracefully: if a model can't be downloaded the pipeline continues with rule-based correction only and shows a ⚠️ badge in the header.
 
 
 
37
 
38
- ---
39
 
40
  ## Running locally
41
 
42
  ```bash
43
  python -m venv .venv
44
- source .venv/bin/activate # Windows: .venv\Scripts\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`