Home

Awesome

FSRS Optimizer

PyPi Code style: black

The FSRS Optimizer is a Python library capable of utilizing personal spaced repetition review logs to refine the FSRS algorithm. Designed with the intent of delivering a standardized, universal optimizer to various FSRS implementations across numerous programming languages, this tool is set to establish a ubiquitous standard for spaced repetition review logs. By facilitating the uniformity of learning data among different spaced repetition softwares, it guarantees learners consistent review schedules across a multitude of platforms.

Delve into the underlying principles of the FSRS Optimizer's training process at: https://github.com/open-spaced-repetition/fsrs4anki/wiki/The-mechanism-of-optimization

Explore the mathematical formula of the FSRS model at: https://github.com/open-spaced-repetition/fsrs4anki/wiki/The-Algorithm

Review Logs Schema

The review_logs table captures the review activities performed by users. Each log records the details of a single review instance. The schema for this table is as follows:

Column NameData TypeDescriptionConstraints
card_idinteger or stringThe unique identifier of the flashcard being reviewedNot null
review_timetimestamp in milisecondsThe exact moment when the review took placeNot null
review_ratingintegerThe user's rating for the review. This rating is subjective and depends on how well the user believes they remembered the information on the cardNot null, Values: {1 (Again), 2 (Hard), 3 (Good), 4 (Easy)}
review_stateintegerThe state of the card at the time of review. This describes the learning phase of the cardOptional, Values: {0 (New), 1 (Learning), 2 (Review), 3 (Relearning)}
review_durationintegerThe time spent on reviewing the card, typically in milisecondsOptional, Non-negative

Extra Info:

Notes:

Please ensure your data conforms to this schema for optimal compatibility with the optimization process.

Optimize FSRS with your review logs

Installation

Install the package with the command:

python -m pip install fsrs-optimizer

You should upgrade regularly to make sure you have the most recent version of FSRS-Optimizer:

python -m pip install fsrs-optimizer --upgrade

Opimization

If you have a file named revlog.csv with the above schema, you can run:

python -m fsrs_optimizer "revlog.csv"

Expected Functionality

image

image


Alternative

Are you getting tired of installing torch? Try fsrs-rs-python!