Skip to content

Feat/add extractive summary generator#78

Merged
AAdewunmi merged 4 commits into
mainfrom
feat/add-extractive-summary-generator
May 15, 2026
Merged

Feat/add extractive summary generator#78
AAdewunmi merged 4 commits into
mainfrom
feat/add-extractive-summary-generator

Conversation

@AAdewunmi

Copy link
Copy Markdown
Owner

Summary

Adds a deterministic extractive summary generator for StudyBuddy insights.

Changes

  • Added apps/insights/nlp/summarisation.py.
  • Implemented summarise_text() for source-grounded summaries.
  • Added LOW_INFORMATION_SUMMARY fallback text.
  • Added tests in apps/insights/tests/test_summarisation.py.

Behaviour

  • Splits note text into source sentences.
  • Scores sentences using meaningful tokens and extracted keyword frequency.
  • Selects high-signal source sentences.
  • Returns selected sentences in original source order.
  • Returns a low-information message for empty, sparse, or unusable input.
  • Does not generate new claims or rewrite user notes.

Why

This keeps summaries deterministic, explainable, and grounded in the user’s own study notes, matching the AI/NLP contract for the Sprint 3 MVP.

Validation

  • pytest apps/insights/tests/test_summarisation.py apps/insights/tests/test_nlp_keyword_extraction.py apps/insights/tests/test_nlp_text_processing.py -q
  • TEST_DATABASE_URL=postgres://studybuddy:studybuddy@localhost:5432/studybuddy_test pytest apps/insights -q
  • TEST_DATABASE_URL=postgres://studybuddy:studybuddy@localhost:5432/studybuddy_test pytest -q --reuse-db
  • black . --check
  • ruff check .

Result

Extractive summary generation is implemented and covered by focused tests. The PostgreSQL-backed insights and full regression suites pass.

Notes

This adds summary generation only. Confidence scoring, explanation generation, persistence reuse, and views remain separate follow-up work.

@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… unscored sentences in extractive summary generation
@AAdewunmi AAdewunmi merged commit 9ac3eae into main May 15, 2026
2 checks passed
@AAdewunmi AAdewunmi deleted the feat/add-extractive-summary-generator branch May 15, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sprint-3-ai-nlp-feature-summary Add extractive summary generator

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

Add extractive summary generator

1 participant