Giter Site home page Giter Site logo

ozieblo-michal / boldfish Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.99 MB

Use large language model (LLM) and Bionic Reading to enhance the creation of Anki flashcards

License: MIT License

Python 100.00%
anki anki-flashcards bionic-reading flashcards genanki gpt gpt-3 gpt-4 gpt3 openai

boldfish's Introduction

BOLD FISH

Use large language model (LLM) and Bionic Reading to enhance the creation of Anki flashcards and learning from them!

BOLD FISH

What is it? ๐Ÿ”ฅ

It is a software application that combines the following three actions:

  1. assigns definitions to the indicated concepts using the OpenAI API (Generative Pre-trained Transformer model; gpt-3.5-turbo by default)
  2. formats definitions to Bionic Reading (BR) format
  3. Creates a ready-to-use deck of Anki flashcards

Who is the preferred user? ๐Ÿ‘‹

It is intended for students and professionals who, like the author, have tendencies to list entities on the margin.

The application solves the problem of time-consuming preparation of simple flashcards, and additionally revises texts so that the most concise parts of words are highlighted based on BR method

Why you should try? ๐Ÿ’ก

  1. Flashcards enhance active recall, enhance memorization, and offer portable, efficient learning. They engage your memory effectively for better understanding and retention.
  2. Skim, annotate, and visualize for deep comprehension. Summarize and adapt for optimal retention. Navigate seamlessly, conquer distractions. Elevate study efficiency in the digital era.

Requirements to run ๐Ÿš€

In order to run the package, you must know the basics of Poetry: https://python-poetry.org/docs/

To use the deck, check https://docs.ankiweb.net/getting-started.html

How it works? ๐Ÿš

Using as class methods:

from boldfish import Boldfish

# to use OpenAI to assign definitions
OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY") 

# to use Bionic Reading on definitions
BIONIC_READING_X_RAPID_API_KEY = os.environ.get("BIONIC_READING_X_RAPID_API_KEY") 

# only to assign definitions or create Anki deck
boldfish = Boldfish(OPENAI_API_KEY)

# or

"""
    openai.api_key value automatically by reading it from an environment variable
    named OPENAI_API_KEY. The OpenAI Python library is designed to check for this
    environment variable by default
"""
boldfish = Boldfish()

# to assign definitions, allow format using Bionic Reading or create Anki deck
boldfish = Boldfish(OPENAI_API_KEY, BIONIC_READING_X_RAPID_API_KEY)


# example to assign the definitions, based on string input or the path
definitions = boldfish.get_definitions("fish")
definitions = boldfish.get_definitions("fish, Python, Anki")
definitions = boldfish.get_definitions("./data/test.csv")
definitions = boldfish.get_definitions("./data/test.json")

# to create the deck
# definitions: dictionary entity:'definition'
boldfish.create_deck_of_flashcards(definitions, 
                                   "<<deckName>>",
                                   "<<output-path>>")

Using the CLI:

poetry run python app/cli.py  

Anki BR card example:

files

Log example (CLI):

log

Output example (CLI):

files

Externally provided API ๐Ÿ”—

To use this package you need to provide 2 keys in the .env file: OPENAI_API_KEY and BIONIC_READING_X_RAPID_API_KEY. To get them, you need to create accounts on the API providers website. The use of these APIs is free only under certain conditions. Please refer to the documentation to verify costs.

If you have trouble using the .env file, please check:

poetry env remove 3.10  
sudo poetry cache clear --all pypi
env $(cat .env) poetry shell  
poetry install
poetry run python app/cli.py

Testing and security ๐Ÿš“

Coverage goal before the initial release of v1.0.0 is 100%, including unit, time performance and end-to-end tests.

All stay within localhost (excluding potential data leakage to vendors based on their license - check the terms of use of the API before use).


Comment for those intrigued by the name of the package

If you are intrigued by the name of the package: flashcards in Polish (fiszki) sound similar to the word fish, hence the idea for the name. Have a nice day! ๐ŸŸ

boldfish's People

Contributors

ozieblo avatar ozieblo-michal avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.