Skip to content
Open to SDE roles · full-time and internships +91 90504 57303
Work/B-side
Jan – Feb 2024 · Data structures and algorithms

Corpus Q&A tool

Ranks paragraphs with TF-IDF, matches patterns with KMP and tries, then feeds the best context to an LLM.

C++TF-IDFKMPTriesLLMs

What it does

Ask a question about a large text corpus. Paragraphs are ranked with a TF-IDF scoring scheme, patterns are found with KMP plus tries and heaps, and the top context is sent to ChatGPT or Hugging Face models within strict token limits. The “Ask about my work” box on this site uses the same ranking idea.

Size

630 lines of code.

Next project
Rollerball AI bot
Keep going
CV Contact