bayan-api / src

Commit History

fix: Restore pre-wrap for correct RTL cursor position - Revert white-space to pre-wrap (fixes cursor starting from center) - Override with white-space:normal only for blockquote, ul, ol, li - Lists and indent still render properly
8ebd4a6

youssefreda9 commited on

ui: Replace أ with بيان in font size dropdown preview
be38538

youssefreda9 commited on

fix: Sentence count + reading time stats - Sentences: split by . ! ? ؟ and newlines (not just periods) - At least 1 sentence if text exists, 0 if empty - Reading time: 180 words/min for Arabic, shows 0 when empty - Minimum 1 minute when text exists
1527e69

youssefreda9 commited on

fix: Lists, indent, and keep button - Change white-space from pre-wrap to normal (fixes lists + indent) - Redesign keep button: centered, cleaner, separated from corrections - Keep button always renders last with clear 'إبقاء كما هي' label - Blockquote/list styling for RTL editor
88ad74a

youssefreda9 commited on

fix: Indent/outdent visible styling - blockquote gets right padding + blue border for RTL - Lists (ul/ol) get proper RTL padding - Each indent level nests another blockquote
af0c1dc

youssefreda9 commited on

fix: Critical editor bugs - Dropdowns now visible (remove overflow:hidden from editor-shell) - Font/size/color menus z-index 200 (above editor) - Selection collapses after formatting (no more blue highlight) - Spelling overlay uses textContent for consistent offsets - Correction preserves formatting (replaces inside parent node) - Alt correction same fix - Fallback finds span by matching original text
16da498

youssefreda9 commited on

feat: 12 UI improvements batch - 1. Editor surface flush (no margin/border, Google Docs style) - 2. Custom styled summary slider (gradient thumb) - 3. Empty states with icons for suggestions - 4. Enhanced status bar (chars, sentences, reading time) - 5. Mobile scrollable formatting toolbar - 6. Summary word count + compression ratio - 7. Document search bar with filter - 8. Text color + highlight color pickers - 9. Lists (bullet/ordered) + indent/outdent + clear format - 10. Animated sun/moon theme toggle - 11. Summary bullet points mode toggle - 12. Print styles (only editor content)
afdf449

youssefreda9 commited on

feat: Premium formatting toolbar redesign - Custom dropdown menus for font family and size (animated, styled) - Pill-shaped button groups with gradient active states - Alignment applies to paragraph with selection (standard behavior) - Undo/Redo works for typing + formatting (browser native stack) - Font preview in size dropdown - Professional visual polish
d4d18df

youssefreda9 commited on

feat: Rich text formatting toolbar + formatting-preserving renderer - Bold, Italic, Underline, Strikethrough, Alignment, Undo/Redo - Font family and font size dropdowns - New DOM-level overlay renderer (preserves formatting during analysis) - Apply/dismiss corrections keep original formatting
036913a

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: 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

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

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

perf: Reduce debounce from 1500ms to 1000ms for faster response
afe9be1

youssefreda9 commited on

fix: Increase analyze debounce to 1.5s to prevent text overwrite while typing - Debounce 500ms -> 1500ms - Abort in-flight requests when user starts typing again - Double-check no new input before running analysis
8d7698b

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: Enable ContextualCorrector (BERT MLM) for spelling - Pre-download AutoModelForMaskedLM in Dockerfile
5417c36

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: DNS endpoint discovery - test multiple HF hostnames to find reachable one
f69f6eb

youssefreda9 commited on

fix: Construct RequestParameters with all 6 required args (url, task, model, json, data, headers)
4ff9aed

youssefreda9 commited on

fix: Construct RequestParameters properly using inspect.signature
89d63b5

youssefreda9 commited on

fix: Try multiple _inner_post calling conventions + inspect signature
465c938

youssefreda9 commited on

fix: Use _inner_post transport from InferenceClient v1.19.0
b363fc1

youssefreda9 commited on

debug: Deep diagnostics to find InferenceClient internal transport
381091e

youssefreda9 commited on

fix: Back to InferenceClient with correct method signatures + diagnostics
f8422c2

youssefreda9 commited on

fix: Use requests.post() directly instead of InferenceClient (version compat issue)
ec65ff2

youssefreda9 commited on

fix: Use client.post() for all models, fix summarization params, better error capture
f20252e

youssefreda9 commited on

fix: Use huggingface_hub InferenceClient instead of raw urllib (fixes DNS inside HF Spaces)
062f1e3

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

Fix: Google link failure now falls back to full sign-in instead of error toast
9bc964f

youssefreda9 commited on

Fix: Guest login navigates to home/landing page instead of editor
c46654e

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