DEV Community

Simon
Simon

Posted on • Originally published at Medium

Introducing AI-generated Anki flashcards

Disclaimer: This shows a way how to import AI-generated flashcards into Anki. This is neither about the model's performance regarding the creation of flashcards nor about the suitability of the cards for learning. All the results were created using the free tier of OpenAI's "ChatGPT March 23" version.

While preparing my Anki flashcards for learning I was wondering if ChatGPT would be able to create flashcards from given texts, so I took a paragraph from the book I was studying and pasted it - along with some context information - into the prompt. The result - being genuinely acceptable - surprised me so I continued with fine-tuning the query. Below, you can see the cards that ChatGPT wrote for me. For demonstration, I used a article from Wikipedia about Deep learning:

Screenshot. ChatGPT UI showing generated Anki flashcards about Deep Learning

My Query consisted of this phrase:

The following is a wikipedia article about Deep Learning. Create flashcards for use by Anki. Prefix each question with "Q:" and shorten the answers to two sentences.

following the article's content.

After some experiments in German language, I thought about integration of this feature with Anki itself. In Order to not lock in with OpenAI's models I came up with an update of an addon that was developed some months ago. The Smart Insert addon was originally intended to simplify copy+paste from presentations where inappropriate line breaks and enumerations are carried over to your decks.

As it works with regular expressions internally, the new AI mode could easily be added by filtering question and answer based on the "Q:"/"A:" prefix defined in the prompt. To download the addon go to https://ankiweb.net/shared/info/1303065007 and follow the basic installation instructions. Smart Insert means, that you will be able to copy the note paragraph by paragraph and insert it in one of the fields in the basic card style. The editor will divide the text and paste question and answer into the respective fields. For more information visit https://github.com/swssl/anki-smart-insert.

Top comments (0)