Skip to content

feat: improve furigana filter#41

Merged
sohilsayed merged 2 commits into
sohilsayed:mainfrom
Kellenok:feature/hybrid-furigana-filter
Jul 2, 2026
Merged

feat: improve furigana filter#41
sohilsayed merged 2 commits into
sohilsayed:mainfrom
Kellenok:feature/hybrid-furigana-filter

Conversation

@Kellenok

@Kellenok Kellenok commented Jul 1, 2026

Copy link
Copy Markdown
Contributor
  1. Hybrid Furigana Filter: Replaced the old OwOCR logic with a global filter that checks precise geometry and orientation.
  2. Massive Accuracy Improvement: Achieved 98.8% accuracy (F1-score) on the benchmark dataset vs 89% before, reducing total errors by nearly 9x (false negatives dropped from 77 down to 4, and false positives from 19 down to 7).
  3. Faster Processing: Implemented regex-based "early exits" to skip Kanji and alphanumeric strings, making the filter 20% faster (1.19ms vs 1.47ms per page) despite the more thorough checks.

@Kellenok

Kellenok commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

merger became slightly worse, i'll try improve it tomorrow

@sohilsayed

Copy link
Copy Markdown
Owner

Try to also resolve conflicts

@Kellenok Kellenok force-pushed the feature/hybrid-furigana-filter branch from 1845ec3 to 9deff74 Compare July 2, 2026 17:28
@Kellenok Kellenok force-pushed the feature/hybrid-furigana-filter branch from 44403a6 to 17e4d15 Compare July 2, 2026 17:50
@Kellenok

Kellenok commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

there was more slop code than i expected, sorry

from 100 random manga109 images
before this pr: 64 overmerged, 59 undermerged
after furigana: 60 overmerged, 68 undermerged
after merging fix: 25 overmerged, 25 undermerged

but i checked kuso onna and some other manga and can't say that the results were exactly twice as good as on manga109, just better in some places, worse in others. i don't get it and i'm tired

@Kellenok

Kellenok commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

before / after

image image image

also need to test local engine, i can't now

@sohilsayed

Copy link
Copy Markdown
Owner

honestly looks good enough for me we can always keep it for future work

@sohilsayed sohilsayed merged commit df56768 into sohilsayed:main Jul 2, 2026
1 check failed
sohilsayed added a commit that referenced this pull request Jul 4, 2026
Remove font-family stripping in sanitizeDictionaryStyles() so
dictionary CSS rules like .example-sentence { font-family: serif; }
are preserved instead of being silently discarded.

Closes #41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants