bayan-api / src /app.py

Commit History

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: Proper grammar suggestion generation — keep spelling suggestions, add grammar on top
e30dba5

youssefreda9 commited on

fix: Add missing SequenceMatcher import
2520b3e

youssefreda9 commited on

fix: Rewrite suggestion system — unified diff eliminates text duplication - Instead of mapping grammar offsets back through OffsetMapper (broken), now: - Run full pipeline: spelling -> grammar -> punctuation - Do ONE clean diff: original_text vs final_text - Classify each change as spelling/grammar based on what spelling changed - Guarantees non-overlapping suggestions with correct offsets
82acd08

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

debug: Add grammar diff logging to diagnose missing suggestions
b24cb8f

youssefreda9 commited on

fix: Grammar shows word-level suggestions instead of sentence chunks - Break grammar diffs into individual word changes - Skip grammar suggestions overlapping with spelling - Add alternatives to grammar suggestions - Prevents duplication on Apply All
67e9990

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

feat: Show 3 spelling alternatives + keep-as-is option - Backend: Generate alternatives via EditDistanceCorrector - Tooltip: Multiple clickable correction buttons - Sidebar cards: Alt chips for each suggestion - Dismiss button removes error highlight (keep original word)
1eb5022

youssefreda9 commited on

fix: Handle N-to-M word replacements in analyze post-filter - Process each original word individually against corrected segment - Accept 1-to-1 small edits and 1-to-N word splits within multi-word blocks - Previously all multi-word blocks were silently rejected
f4cabc9

youssefreda9 commited on

fix: Relax analyze post-filters to show AraSpell corrections in editor - Allow 3 char edits (was 2), 50% ratio (was 40%) - Lower word-split threshold from 12 to 5 chars
e653046

youssefreda9 commited on

feat: Wire /api/analyze to use AraSpell service for real-time editor spelling
d85261e

youssefreda9 commited on

fix: Remove duplicate /api/spelling route causing AssertionError
a1871da

youssefreda9 commited on

feat: Add AraSpell spelling correction endpoint (POST /api/spelling) with lazy model loading - Extract AraSpell pipeline into src/nlp/spelling/ (araspell_rules.py + araspell_service.py) - Pre-download AraBERT encoder-decoder + checkpoint in Dockerfile - Lazy load on first request, contextual=False to save RAM - Update health check to report spelling status
8ba2b52

youssefreda9 commited on

fix: Always load models on import (RENDER/GUNICORN_LOADED env vars not set in HF Spaces)
c6e2341

youssefreda9 commited on

debug: Add startup error tracking + memory info to debug endpoint
4718622

youssefreda9 commited on

fix: Load summarization model locally with float16 (HF free tier has no outbound DNS)
dd64fe1

youssefreda9 commited on

fix: Add wait_for_model, debug endpoint, and better HF API error handling
483ffaf

youssefreda9 commited on

feat: Switch all NLP models to HuggingFace Inference API
cfe3b4c

youssefreda9 commited on

authDone Ready for deployment
a281968

youssefreda9 commited on

added light theme and ISLAMIC RAG and fixed the UI/UX issues and added the auth
41e1749

MAtef24 commited on

initial UI
7bf7d5b

MAtef24 commited on