rishach's picture
README.md
405e03a verified
|
Raw
History Blame Contribute Delete
1.42 kB

A newer version of the Streamlit SDK is available: 1.59.1

Upgrade
metadata
title: 'AI Flashcard Generator '
sdk: streamlit
emoji: 📚
colorFrom: blue
colorTo: purple
pinned: false
sdk_version: 1.58.0
app_file: app.py

AI-Powered Flashcard Generator

A Streamlit web app that turns lecture notes into exam-revision flashcards.

Features

  • Upload lecture notes as PDF, TXT, or image files.
  • Extract and clean raw text with PyMuPDF for PDFs.
  • Split notes into 300-500 token chunks.
  • Summarise chunks with a Hugging Face T5/BART model.
  • Use LangChain prompt templates for a three-step generation pipeline:
    • Extract key concepts as JSON.
    • Generate Q&A flashcards as JSON.
    • Optionally rewrite easy cards into harder Bloom's Taxonomy questions.
  • Export flashcards as Anki-compatible CSV.
  • Optionally export .apkg when genanki is installed.

Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Run

streamlit run app.py

The first summarisation run can take a while because Transformers may download the selected model.

Test

pytest

Notes

  • Image extraction uses pytesseract when it is installed and Tesseract OCR is available on your system.
  • If Hugging Face model loading fails, the app falls back to a deterministic extractive summary so the project remains usable offline.
  • CSV exports can be imported into Anki with the first field as Front and the second field as Back.