bayan-api / src /nlp /grammar

Commit History

Fix grammar JSON spacing bug
f857072

youssefreda9 commited on

Fix structural regressions
c12904f

youssefreda9 commited on

Fix: 10 critical NLP logic bugs in grammar, spelling, and punctuation to prevent false positives
cf83a1a

youssefreda9 commited on

Fix plural adjective agreement regression for broken plurals
8bc038b

youssefreda9 commited on

Fix 30 NLP edge cases in Grammar, Spelling, and Punctuation (Phase 10 results and Extension UI improvements)
ee5e504

youssefreda9 commited on

fix(grammar): add hamza fixes for ايضا, اول, and position-aware إنّ/أنّ rules
e6b20e0

youssefreda9 Claude Opus 4.6 commited on

update benchmark logs
aea385b

youssefreda9 commited on

Fix collision benchmark failures: patch overlap mapping, tokenization guard, and rule hallucinations
8860627

youssefreda9 commited on

Fix punctuation alignment and hallucinations, add punctuation safety rules, add kana/inna grammar rules
6effc77

youssefreda9 commited on

feat(nlp): implement case-checking rules for kana and inna sisters using camel_tools
c08879e

youssefreda9 commited on

Add debugging scripts and fix grammar/punctuation logic
75190ee

Bayan AI commited on

fix: verb suffix stripping, regex unnormalized hamzas, and POS-independent triggers to reach 70%
3ba5544

Bayan AI commited on

refactor: simplify architecture and replace whitelists with CamelTools
a4fd3e7

Bayan AI commited on

Fix: Enhance Jazm and Nasb logic with camel_tools for Af'al Khamsa and defective verbs
bbfe996

Bayan AI commited on

FIX-38/39 + Layer 1/2/3: Benchmark normalization + spelling safety + grammar rules
eae5d36

youssefreda9 commited on

FIX-33b: Protect second+third preposition regexes with blocklist
17a3ac2

youssefreda9 commited on

FIX-33/34/35: Fix infinite loop — grammar corruption + spelling conflict
4616185

youssefreda9 commited on

Fix grammar rules output log — remove hardcoded ... truncation marker
f4e59e5

youssefreda9 commited on

Phase 14c: Fix FIX-31 whitespace bug + fix misleading log truncation
ca212fd

youssefreda9 commited on

Fix: TerminalPunctuationGuard for short phrases and comprehensive Nasb/Jazm grammar rules fixes
31a6db1

Bayan AI commited on

Feat: Add demonstrative and noun-adjective dual/plural agreement rules
19a801d

Bayan AI commited on

Fix: Prevent conditional sentences rule from overcorrecting 'إن' and 'من' by requiring the subsequent word to be a verb
4c96469

Bayan AI commited on

Fix: Preserve input punctuation during grammar correction
54052f7

Bayan AI commited on

HOTFIX: Remove broad preposition/nasb regex rules — caused Hallucination 0%, +38 FP
2fe1569

youssefreda9 commited on

Critical: Isolate grammar rules in try/except so regex fallback ALWAYS runs
722789f

youssefreda9 commited on

Phase 13: Grammar SV/gender whitelist, preposition/nasb regex, pronoun-h guard
e909fa9

youssefreda9 commited on

Phase 12: Fix 6 batches — grammar pipeline bypass, religious/structured protection, punct rearrangement, SV/gender agreement
015c7b7

youssefreda9 commited on

Phase 11: Master Bug Fix — 23 fixes across 8 files
095e270

youssefreda9 commited on

Phase 8: Fix all critical bugs from adversarial validation
1159492

youssefreda9 commited on

fix(critical): stop spelling from corrupting correct words + fix pronoun agreement + reject hallucinations
a16af4a

youssefreda9 commited on

fix: all model bugs — S1 S2 S3 G1 P1 (6 fixes across 4 files)
e68c40c

youssefreda9 commited on

fix: Grammar Gradio client retry with exponential backoff (3 attempts, 2s/4s/8s)
f622abb

youssefreda9 commited on

fix: Grammar retry on rate-limit + cursor position after correction
4bde1ea

youssefreda9 commited on

fix: Grammar rules false positive - الامتحان was incorrectly matched - Increased minimum stem length from 2 to 4 in fix_prepositions_advanced - Prevents root-level ان endings (الامتحان, الإنسان) from being treated as grammatical ون/ان
3f4dd4a

youssefreda9 commited on

feat: NLP-2 Grammar Integration — dependency-aware pipeline - Add grammar_rules.py (ArabicGrammarGuard from Grammer_Rules.py with camel-tools) - Add grammar_service.py (lazy-loaded Gradio Client + rules pipeline) - Wire /api/grammar endpoint to real grammar service - Wire /api/analyze Step 2 to grammar (receives AraSpell output) - Update /api/health to report grammar status - Add gradio_client to requirements.txt - Add camel_data download to Dockerfile - Frontend unchanged (already supports grammar-error yellow highlighting)
29371b1

youssefreda9 commited on

feat: Professional editor UI redesign - 3-column layout (docs | editor | sidebar) - Documents panel always visible on desktop - Import/export moved to left sidebar - Removed CTA button from nav - Replaced all emojis with SVG icons - Clean toolbar with separator - Mobile: docs stay as overlay sidebar
040f556

youssefreda9 commited on

fix: Remove 'Apply All' button - conflicts with spelling+grammar pipeline
6a75183

youssefreda9 commited on

fix: Word-level grammar suggestions + robust grammar model validation
deebedd

youssefreda9 commited on

fix: Prevent overlapping spelling+grammar suggestions from duplicating text - Backend: Skip grammar suggestions that overlap with existing spelling ranges - Frontend: applyAllSuggestions skips overlapping ranges to prevent duplication
280e12b

youssefreda9 commited on

revert: Restore ORIGINAL grammar params that were working (num_beams=4, max_length=512) - Remove all hallucination checks that were blocking valid corrections - The model WAS correcting ذهب→ذهبت before, only highlight was wrong - Keep word-level diff fix (in app.py) + raw output logging
d024208

youssefreda9 commited on

fix: Switch grammar to greedy decoding + stronger anti-hallucination - num_beams=1 (greedy, most stable for seq2seq correction) - repetition_penalty=2.0 (strong anti-repeat) - Log raw model output before hallucination check - Tightened bigram duplicate detection
e4be28c

youssefreda9 commited on

fix: Prevent grammar model hallucination (rearranging/duplicating text) - Dynamic max_length (1.3x input instead of fixed 512) - repetition_penalty=1.5 to discourage repeating - Reduce beams 4→2 (less hallucination on CPU) - Add _is_hallucinated() safety checker: output length, word count, repeated phrases, sentence rearrangement
906ecc8

youssefreda9 commited on

feat: NLP-2 Grammar model integration (Bayan_Arabic_Grammar T5) - New: src/nlp/grammar/grammar_service.py (lazy T5 loading) - Dockerfile: pre-download grammar model (2.14GB safetensors) - Wire /api/analyze Step 2 to grammar service - Update /api/grammar standalone endpoint - Add _grammar_available() health check
c18d65d

youssefreda9 commited on