Skip to content

[LLM] Implement sentence readability scorer with level bucketing - #6

Merged
menny merged 1 commit into
mainfrom
sentence-scorer
Oct 16, 2026
Merged

menny merged 1 commit into
mainfrom
sentence-scorer

Conversation

@menny

@menny menny commented Oct 16, 2026

Copy link
Copy Markdown
Member

Summary

Implements Step 4 of Pipeline 1 from docs/INGESTION.md:

  • SentenceScorer.tokenizeWords: Unicode-aware word tokenization using java.text.BreakIterator for Spanish.
  • SentenceScorer.scoreSentence: Evaluates sentence difficulty based on word count (4..14), subtitle frequency rank (>1500 as rare), transparent cognate ratio, and subjunctive/conditional tenses (+3.0 penalty).
  • Buckets valid sentences into LEVEL_0 (<= 2.0), LEVEL_1 (<= 4.0), or LEVEL_2 (<= 6.5), discarding sentences outside length constraints or exceeding difficulty thresholds.
  • Comprehensive unit tests in SentenceScorerTest covering length bounds, score calculations, edge cases, and Spanish punctuation.

Verification

  • bazelisk run //:format.check passed
  • bazelisk build --config=lint //... passed
  • bazelisk test //... passed

Implement Step 4 of Pipeline 1 from INGESTION.md in SentenceScorer with BreakIterator tokenization, rarity ratio, cognate ratio, complex tense penalty, and level bucketing into Levels 0-2 or discard. Add comprehensive unit tests.
@menny
menny added this pull request to stack #8 October 16, 2026 01:55
@menny
menny merged commit abb6a51 into main Oct 16, 2026
1 check passed
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.

1 participant