Productivity
Unlocking Understanding, One Card at a Time
[!NOTE] Alpha quality software!.
Leerming is an open-source Django-based web app that follows the Leitner box method. Create flashcards effortlessly from PDFs, videos, and web links. Supercharge your learning experience.
The Leitner box method is a simple yet effective technique for learning and retaining information. It works by organizing flashcards into different boxes or levels. As you study, correctly answered flashcards move to higher boxes, while incorrect ones move down. This spaced repetition system helps reinforce your memory over time.
For a more detailed explanation of the Leitner box method, check out Wikipedia.
Flashcards are organized into seven distinct levels. Each card starts at Level 1. The transition between levels is based on performance during reviews.
Each level corresponds to a specific number of days between reviews. For example, Level 1 cards are reviewed daily, while Level 2 cards are reviewed every two days. The exact mapping can be found in the codebase here.
During a review, when a card is answered correctly, it moves up to the next level. Once a card reaches Level 7, it is marked as mastered.
On the other hand, if a card is answered incorrectly during a review, it is downgraded to Level 1, regardless of its previous level. This ensures that challenging material is revisited frequently, while mastered content is reviewed less frequently.
Leerming can currently generate flashcards from web pages, YouTube videos, PDF files and Microsoft Word documents.
Text Extraction: Uploaded documents, regardless of their original format, undergo automated text extraction, transforming the content into a common text format.
Text Segmentation and Storage: The extracted text is divided into smaller, manageable chunks. For each chunk, we generate embeddings using OpenAI's models. These embeddings, along with the original text content, are then stored in a PostgreSQL database equipped with pgvector. This step is executed by a dedicated worker process.
Key Question as Focal Point: Users provide a key question that serve as a central topic for generating flashcards. Additionally, users select one of their uploaded documents.
Chunk Matching with L2Distance: Leerming identifies document chunks that are closest to the user's key question using L2Distance, ensuring the relevance of the generated flashcards.
Prompt Generation with Language Models (LLM): Using the key question and the identified document chunks, Leerming generates an LLM prompt. This prompt is then sent to Language Models (LLM) to generate flashcards.
Ensure you have the following prerequisites in place:
requirements-dev.lock
in the project root with any tool that supports the Python requirements.txt
format.Follow these steps to set up and run Leerming locally:
git clone https://github.com/tobi-de/leerming.git
cd leerming
rye shell
rye sync
.env
file by copying from .env.template
and fill it out: cp .env.template .env
python manage.py migrate
python manage.py createcachetable
python manage.py installwatson
python manage.py makesuperuser
python manage.py runserver