Archive for category Technical skills

SRS Flashcard Algorithm: “Bucket-SRS”

The Spacial-Repetition-System (SRS) uses the theory that the brain forgets information over time and must be ‘refreshed’ at determined time intervals in order to imprint the information more permanently.

I have been working on a ANKI style flash-card app for Android and iPhone (StudyNWalk, if you are interested) and I required an algorithm for selecting cards to present to the user. After looking at various algorithms with varying complexity, I decided to have a go and implement my own simplified version.
I’d like to call my implementation “Bucket-SRS” because it doesn’t care about the time between each repetition, rather than a random selection based on the answers. In fact, I found it to be quite similar to the Leitner system

Each card is given an individual “status” or put in to one of 4 buckets.

  • 0 Unseen
  • 1 Repeat Once
  • 2 Repeat Twice
  • 3 Completed

At the start, all cards are set to Unseen, and the client application will select a card at random and present it to the user.

The user then changes the status of the card depending on their answer to the card, and continue by showing the next randomly selected card. The process is complete when all the cards are in the 3 Completed bucket. One of Two answers may be given to a card, Good or Bad. Good means the user knew the card’s information and could recall with little difficulty, Bad means the user had trouble recalling the information or didn’t know at all.

The random selection of a card is governed by the following rules:

A selection variable is set by counting the number of cards with a 2 Repeat Twice and 1 Repeat Once status. A 2 Repeat Twice card is counted with double value.

iSelection = (2 x “2 Repeat Twice”) + “1 Repeat Once”

if this variable iSelection is < 10, the next random selected card will be a 0 Unseen card.

if the variable iSelection is > 20, the next random selected card can only be a 1 Repeat Once or 2 Repeat Twice card.

if the number lies between 10 and 20, a random selection for any of the 3 types is done.
When answering a card, the status is changed according to its current status and answer given.
If “BAD”  is answered, the status is set to 2 Repeat Twice each time.
If “GOOD” is answered, the status is changed according to its current status:
0 Unseen -> 1 Repeat Once
1 Repeat Once -> 3 Completed
2 Repeat Twice -> 1 Repeat Once

The main features of this algorithm is that it controls the number of new cards vs repetitions of old cards introduced depending on the user’s skill level. If the user continually doesn’t know the answer, only 10 cards are shown until the user begins to learn them. If the user knows all the cards (i.e. for practise only) each card is only shown twice and the user can get through the list of cards as quickly as possible. If the user knows _some_ of the cards but has difficulty with others, the words with difficulty are retained for repeating, whilst allowing the known words to pass through quickly. The difficulty level therefore will always match the user’s ability.

My current implementation uses SQLITE database to hold the card data and statuses, with JAVA and Objective-C clients to access the data for the relevant platforms.

Currently I am using this Algorithm in my own Flashcard app on Android and App-Store and it largely functions as required. A problem I have found however is that due to the random selection of the cards, the chance that the same is selected two or three times in a row is quite high. In a deck of 150 cards that has happened to me at least 5 times. A fix in future might be to ensure the same card is not picked twice if possible.

Share Button
No Comments

Create your own ANKI deck with automated translations and voices: Part 5

This is the final post in a series about creating your own ANKI SRS card deck for learning a foreign language.

This year I wrote about a method to create ANKI flash card data, using google Spreadsheet and some scripting to pick up mp3s from google translate. I found it an effective way to study vocabulary for Chinese, and particularly listening for new words as it embeds the voices to words as well.

Recently I developed an app to take care of the scripting parts of the tutorial. It works on windows and mac. Here is a video showing its use.

By using this app you can create your own ANKI Card structures that can aid to your own learning.

One example is I sometimes study on the train or whilst walking, but I cant look at the screen. In that case I build a Flashcard deck that consists of English and Chinese sounds only.

 

REQUIREMENTS:: this app requires MONO runtime to work
I haven’t made an install package yet so please grab this before running the app (if you don’t have MonoDevelop or Xamarin installed)
Card Generator MAC
http://download.mono-project.com/archive/3.2.1/macos-10-x86/MonoFramework-MRE-3.2.1_1.macos10.xamarin.x86.pkg – Mono run time for mac
https://docs.google.com/file/d/0BxEgxZPzMLVEVEp6VXh0d2JDaUE/edit?pli=1 – The CardGenerator app.

Card Generator WINDOWS
http://download.mono-project.com/archive/2.10.9/windows-installer/0/mono-2.10.9-gtksharp-2.12.11-win32-0.exe – The mono runtime
https://docs.google.com/file/d/0BxEgxZPzMLVEV0RsRTdyRnlEeXc/edit?usp=sharing – the CardGenerator App. Please unzip and then run the application file (CardGenerator3.exe) from the folder inside

SOURCE CODE
Available at https://github.com/martinogg/CardGeneratorANKI for those who are interested.

If you have any suggestions or feedback, please let me know.

Development

This app was developed using C# in GTK# / mono with Xamarin IDE. It took about 80 hrs to develop. It uses a standard SQLite database file for storage and connects to google translate to obtain the mp3s. The decision for this platform was because I wanted to use a managed code system for quick development and have multi-platform capability too.

 

Share Button
4 Comments