Repository navigation
fix(elos): better grounded answers on real course slides; faster MCP sources - #24
Conversation
…sources
Found by running the tutor on a real 226-file course library:
- answers now rerank BM25 hits: duplicates removed, slide titles and quiz
questions penalised, explanatory/definition passages favoured, oral
transcripts ranked after written material; quoted sentences deduplicated
- LaTeX-made PDFs: spacing accents recomposed ("exprim ́ ee" → "exprimée")
- MCP server: extraction cached per file (size + mtime), 1,000-file cap,
first folder = subject, second = origin (first load ~10 s for ~4,000
pages, then ~7 ms)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc3a7f156d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export function cleanExtractedText(text: string): string { | ||
| return text | ||
| // LaTeX-made PDFs extract accents as separate marks before the letter ("exprim ́ ee" → "exprimée"). | ||
| .replace(/ ?([\u00B4\u0060\u02C6\u00A8\u0300-\u0302\u0308]) ?([aeiouAEIOU])/g, (_match, mark: string, letter: string) => (letter + SPACING_ACCENTS[mark]).normalize("NFC")) |
There was a problem hiding this comment.
Preserve ASCII backticks in imported course text
When Markdown or text contains code whose opening backtick precedes a vowel, such as `echo`, `awk`, or `uname`, this replacement treats U+0060 as a grave accent and also consumes the preceding space, producing corrupted strings such as ècho, àwk, and ùname merged into surrounding text. Because cleanExtractedText processes Markdown and plain-text sources as well as PDF extraction, this damages common commands, citations, and retrieval terms; restrict the repair to extraction-specific accent contexts rather than treating every ASCII backtick as an accent.
Useful? React with 👍 / 👎.
| return splitSentences(hit.passage.text) | ||
| .map((sentence, index) => ({ sentence, index, overlap: tokenize(sentence).filter((token) => terms.has(token)).length })) | ||
| .filter((item) => item.overlap > 0) | ||
| .filter((item) => item.overlap > 0 && !isQuestionLike(item.sentence) && item.sentence.split(/\s+/).length >= 4) |
There was a problem hiding this comment.
Allow concise declarative source answers
When the only relevant source sentence has fewer than four whitespace-separated words, such as TCP est fiable., the passage passes retrieval and answerability but this filter removes its sole sentence, causing answerFromSources to report that the information is absent. The previous implementation returned such exact source answers, so title suppression should not use an unconditional four-word minimum for otherwise declarative, relevant sentences.
Useful? React with 👍 / 👎.
Tuning from a real 226-file course library (slides, TPs, transcripts):
Real-library probe: 7/8 course questions answered with relevant cited passages, off-topic question refused.
Test plan
npm test647/647, typecheck,eslint ., build🤖 Generated with Claude Code