Skip to content

Feat/generate user facing nlp explanations#80

Merged
AAdewunmi merged 6 commits into
mainfrom
feat/generate-user-facing-NLP-explanations
May 17, 2026
Merged

Feat/generate user facing nlp explanations#80
AAdewunmi merged 6 commits into
mainfrom
feat/generate-user-facing-NLP-explanations

Conversation

@AAdewunmi

Copy link
Copy Markdown
Owner

Summary

Adds user-facing NLP explanations for StudyBuddy insights.

Changes

  • Added deterministic explanation generation in apps/insights/nlp/explanations.py.
  • Added direct explanation tests in apps/insights/tests/test_explanations.py.
  • Updated docs/ai-nlp-contract.md to document explanation behaviour as current test coverage.
  • Added Sprint 3 Day 3 console verification runbook.

Behaviour

  • Explains the confidence label used for an insight.
  • Shows how many meaningful terms were analysed.
  • States that keywords are ranked by deterministic term frequency.
  • States that summaries use original note sentences rather than generated claims.
  • Lists detected keywords.
  • Handles missing keywords with no strong repeated terms.
  • Handles low-information input by asking for more detailed notes instead of overstating insight quality.

Why

Explanations keep the NLP feature transparent and honest. They help users understand that insights come from deterministic text processing, not model intelligence or unsupported generated claims.

Validation

  • pytest apps/insights/tests/test_explanations.py -q
  • pytest apps/insights/tests/test_summarisation.py apps/insights/tests/test_confidence.py apps/insights/tests/test_explanations.py -q
  • pytest apps/insights -q
  • pytest -q
  • ruff check apps/insights/tests/test_explanations.py
  • black --check apps/insights/tests/test_explanations.py
  • ./docs/sprint-runbook/sprint-3/sprint-3-day-3.sh

Result

All targeted NLP tests, insights tests, full regression tests, lint checks, format checks, and the Sprint 3 Day 3 runbook pass.

Notes

This remains deterministic NLP. The explanation text does not imply LLM use, semantic understanding, probability, or factual correctness.

@codecov

codecov Bot commented May 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AAdewunmi AAdewunmi merged commit bf5e61e into main May 17, 2026
2 checks passed
@AAdewunmi AAdewunmi deleted the feat/generate-user-facing-NLP-explanations branch May 17, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sprint-3-ai-documentation-product-summary Generate user-facing NLP explanations

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

Generate user-facing NLP explanations

1 participant