class: center, middle # Don't forget to remember .subtitle[Anki memorization software] ![AnkiDroid logo](img/ankidroid-logo.png) 2018/04/28, Lukas Prokop ??? * wonderful journey through linguistics, neurosciences, math and CS * extended version * GLT committee * alternative title --- class: center, middle # How to store efficiently in human, volatile memory .subtitle[Anki memorization software] ![AnkiDroid logo](img/ankidroid-logo.png) 2018/04/28, Lukas Prokop --- # Agenda In essence: digital flashcards 1. About me & motivation 2. The neuroscience of memory 3. Custom implementation & usecase analysis 4. Anki, AnkiDroid and AnkiWeb 5. Conclusion ??? Okay, ready? Let's start --- class: center, middle # About me & motivation
[part 1/5]
--- # About me * [@meisterluk](https://twitter.com/meisterluk) * self-employed software developer * been to Japan as student for 1 year in 2016/2017
??? hire me for python, Go or rust! --- class: middle ![Aikidō](img/IMG_20170521_145806.jpg) ??? Japan is interesting --- class: middle ![Hanami](img/P1050804.JPG) ??? Japan is beautiful --- class: middle ![Kanji](img/P1050813.JPG) ??? … but in Japan, they use a lot of characters. --- ## Motivation: Japanese script * Hiragana (45 + 25 characters) * Katakana (47 + 25 characters) * Kanji How many Kanji? * 2,136 Jōyō kanji. * Secondary school-level. * [Wikipedia: Jōyō kanji](https://en.wikipedia.org/wiki/J%C5%8Dy%C5%8D_kanji) --- ## Motivation: Japanese script ![Studying Kanji from a book](img/kanji_annotated.jpg) ??? * LT: enumeration going loosely with the number of strokes * the Jōyō kanji with most strokes 鬱 has 29 and means depression * below: shape of the characters * to the right: translated semantics * to the right: vocabulary with the Kanji in different contexts * below, you will find the pronunciation in Hiragana on the left * and the stroke order to the right * History is a rare example: it has only one pronunciation --- ## Motivation: Japanese script * Recognition 1. Shape to meaning * Recall 1. Meaning to Shape 2. Associated vocabulary 3. Pronunciation 4. Stroke order ??? * Recognition is easy. * Recall is difficult. * That's why GUIs are more popular for beginners than CLIs --- ## Motivation: Japanese script I hate rendaku.
大
(
おお
)
文
(
も
)
字
(
じ
)
versus
一
(
いち
)
文
(
も
ん
)
字
(
じ
)
--- ## Motivation: Task setting * Study them efficiently! * Remember Kanji long-term. **Remark:** * I am bad at memorizing * “learning by doing” versus “learning by heart” ??? Negligible difference between learning by doing and learning by heart. Ridiculous. If you do it, you repeat it. … --- class: center, middle # The neuroscience of memory
[part 2/5]
--- ## The neuroscience of memory
.right[via [Wikipedia: Memorization](https://en.wikipedia.org/wiki/Memorization)] ??? * distinction from memory masters * semantic knowledge is much different --- ## The neuroscience of memory The **Testing effect** > Recent studies […] demonstrated > that tests positively affect the long-term memory (long-term > information retention), suggesting that individuals tested > for one kind of material, with successful recall, will better > remember this material in the near future. Researchers have > called this phenomenon the “testing effect” (Roediger & > Karpicke, 2006b). > The testing effect is extremely robust > since, as demonstrated in this review, it has been replicated > in dozens of studies. via [“A Systematic Review of the Testing Effect in Learning” (Eisenkraemer, et al; 2013)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.428.7943) ??? * tests * long-term memory * with successful recall * called it “testing effect” * extremely robust --- ## The neuroscience of memory The **forgetting curve** hypothesizes the decline of memory retention in time [via [Wikipedia](https://en.wikipedia.org/wiki/Forgetting_curve)].
??? How about a single item to remember? As an example, remember some car's license plate outside. If below some horizontal line, cannot won't recall it Depends on complexity. One of 26 letters is much easier. --- ## The neuroscience of memory The **forgetting curve** hypothesizes the decline of memory retention in time [via [Wikipedia](https://en.wikipedia.org/wiki/Forgetting_curve)].
??? The better, you already remember an item, the longer you will retain it --- ## The neuroscience of memory Hours? Days? Weeks? > It is well known that increasing the absolute spacing between > repetitions improves retention, especially in the long term (for > review, see Greene, 2008). > Increasing the absolute spacing of retrieval attempts has > clear value for learning, but how tests are spaced > relative to one another may not be critical. via [“Spaced Retrieval: Absolute Spacing Enhances Learning Regardless of Relative Spacing” (Karpicke, Bauernschmidt; 2011)](http://learninglab.psych.purdue.edu/downloads/2011_Karpicke_Bauernschmidt_JEPLMC.pdf) ⇒ Doesn't matter much, but expanding total time is worth it --- ## The neuroscience of memory
Figure: Index cards
??? Multiple choice is bad --- ## The neuroscience of memory The **Leitner system** (1970)
??? 1. You start with all flashcards in box 1. 2. In every 1st session, you will review all flashcards in box 1. In every 2nd … 3. If correct, they move one box to the right. If false, then move one box to the left. 4. Goal: get all to box 5 --- ## The neuroscience of memory Conclusion? * testing strengthens recall * we flatten the forgetting curve with repetition/reviews * Relative spacing is minorly relevant We want: * Leitner system(-like) in the digital age * Don't carry analogue flashcards around * Don't want to maintain last review time --- ## The neuroscience of memory The general concept: > Spaced repetition is a learning technique that incorporates increasing intervals of time between subsequent review of previously learned material in order to exploit the psychological spacing effect via [Wikipedia](https://en.wikipedia.org/wiki/Spaced_repetition) --- class: center, middle ## A custom implementation
[part 3/5]
--- ## A custom implementation A (basic) usecase analysis. 1. You study the topics on your own. -- 2. You retrieve/create flashcards about the topic. -- 3. You review flashcards with front (Q) and back-side (A) -- 4. Your forgetting curve is vaguely assumed to be reciprocally exponential (like exp(-x)) -- 5. Multimedia support (audio files, video files) --- ## A custom implementation Simple: 1. Use two timestamp t₁ and t₂ 2. Offer review, if t₂ ≥ now 3. If successful, t₂ ≔ now + (t₂ - t₁) * 2 and t₁ ≔ now
If unsuccessful, t₂ ≔ now + (t₂ - t₁) / 2 and t₁ ≔ now --- ## A custom implementation ```python import datetime def review(t1, t2, success): """A simple exponential review function""" now = datetime.datetime.now() return now + (t2 - t1) * 2**(1 if success else -1) if __name__ == '__main__': now = datetime.datetime.now() one_hour_ago = now - datetime.timedelta(hours=1) ten_minutes_ago = now - datetime.timedelta(seconds=10 * 60) print(review(one_hour_ago, ten_minutes_ago, True)) ``` --- ## A custom implementation An (advanced) usecase analysis. 1. How about weekends? How about sleep times? Delay? -- 2. Arrange flashcards by order (category, new ones 1st, etc) -- 3. Show mnemonics to remember them better -- 4. Dependencies: Flashcard X iff Y has been studied -- 5. Let user type/speak/draw answer -- 6. User input should accept typos, show difference to actual solution -- 7. I don't want to review this card just now. -- 8. Cards in hierarchical structure --- class: center, middle ## Personalize your flashcards! --- ## A custom implementation An (advanced) usecase analysis.
Speedup factor based on difficulty of question
Study independent of schedule
Flip front and back side
Synchronize with server (multi-device usecase)
Night-mode, if you want to study before going to sleep
Backups for flashcard collections
Clozes: “Python was designed in […]”
⇒ “Python was designed in 1989”
Gamification: I reached level N and want to continue!
??? Level is implicit: once the time of the item is above 1 week, it reached level $whatever --- ## What is a good flashcard? Subset of [SuperMemo: 20 rules](https://www.supermemo.com/en/articles/20rules) * Learn before you memorize -- * Stick to the minimum information principle (simple is easy, repetitions of simple items are easier to schedule) -- * Use multimedia -- * Avoid sets & enumerations -- * Context cues simplify wording -- * Optimize wording --- ## What is a good flashcard? Personal remarks: * Put the effort into studying, not creating flashcards * ~200 reviews per day is maximum for me * Discipline is important --- ## Competitors to Anki
SuperMemo
generic, proprietary
Mnemosyne
generic, FLOSS
AnyMemo
generic, FLOSS
cram.com
generic, proprietary
WaniKani
Kanji, proprietary
Skritter
CN/JP characters, proprietary
--- class: center, middle ## Anki, AnkiDroid and AnkiWeb
[part 4/5]
--- ## Anki, AnkiDroid and AnkiWeb ![Anki at Jisho](img/jisho-anki.png) --- ## Anki, AnkiDroid and AnkiWeb Anki is very mature. Maintained by Damien Elmes since 2006/10/05. * Covers almost all usecases mentioned before¹ * Uses HTML and CSS as representation technologies * Import/export CSV * apkg-files contain flashcards * zip archive * sqlite3 DB * media files --- ## Anki, AnkiDroid and AnkiWeb Software: * Anki²: Desktop client * AnkiDroid²: Android client [manual](https://docs.ankidroid.org/manual.html) * AnkiWeb: Synchronization server with public shared space * Anki App: iOS client ¹ Not included: Weekend delays, Dependencies, speak/draw answer, no typo autocorrect, gamification
² Free/Libre Open Source Software --- ## Anki, AnkiDroid and AnkiWeb Review function: * [github.com/dae/anki/.../sched.py#L518](https://github.com/dae/anki/blob/4446b85ef262ad52f4a2c303607337e0208ae3cc/anki/sched.py#L518) * [github.com/dae/anki/.../sched.py#L598](https://github.com/dae/anki/blob/4446b85ef262ad52f4a2c303607337e0208ae3cc/anki/sched.py#L598) Parameters are not documented. Day-based. ```python def _rescheduleAsRev(self, card, conf, early): lapse = card.type == 2 if lapse: if self._resched(card): card.due = max(self.today+1, card.odue) else: card.due = card.odue card.odue = 0 else: self._rescheduleNew(card, conf, early) [...] ``` --- ## Anki, AnkiDroid and AnkiWeb SRS/Anki terminology
Bury card
Hides a card or all of the note’s cards from review until the next day
Suspend card
Hides a card or all of the note’s cards from review until they are manually unsuspended (by clicking the suspend button in the browser).
Leech
Leeches are cards that you keep on forgetting. Because they require so many reviews, they take up a lot more of your time than other cards.
--- # Some media files follow * Create a simple flashcard * Import deck from AnkiWeb * AnkiWeb screenshots * AnkiWeb as uploader * The colors blue, green, red * Anki review interface * Card browser * Input difference * CSV import * LaTeX on AnkiDroid --- class: center
--- class: center
--- class: center
--- class: center ## Anki, AnkiDroid and AnkiWeb ![AnkiWeb main page](img/ankiweb-shared-deck.png) --- class: center ## Anki, AnkiDroid and AnkiWeb ![AnkiWeb main page](img/ankiweb-shared-deck-2.png) --- class: center ## Anki, AnkiDroid and AnkiWeb ![AnkiWeb main page](img/ankiweb-shared-deck-3.png) --- ## Anki and AnkiDroid ![AnkiWeb main page](img/ankiweb-mainscreen-2.png)
■
New cards
■
Due today
■
Learning now --- class: center ## Anki, AnkiDroid and AnkiWeb
--- class: center ## Anki review interface ![Anki desktop client review screen](img/anki-review.png) --- class: center ## Anki, AnkiDroid and AnkiWeb
--- class: center ## Anki, AnkiDroid and AnkiWeb
--- class: center ## Anki, AnkiDroid and AnkiWeb
--- class: center ## Anki, AnkiDroid and AnkiWeb
--- class: center, middle ## Conclusion
[part 5/5]
--- ## Memorization usecases * Language * writing systems * conversation / speech * Medicine * anatomy * Math * identities, equations * theorems, proofs --- ## Memorization usecases * Semantics of LaTeX commands * IT and Linux * top-level domains ↔ countries * port numbers ↔ service name * custom unit (e.g. meter) ↔ foreign unit (e.g. ) * syscalls ↔ meaning * UNIX CLI commands and parameters --- ## My message today General message > Do a small exercise every day to acquire skills over time My point today > I was able to study Japanese with the power of FLOSS --- ## Thanks [Share some love with the awesome Anki team!](https://www.thankyouopensource.com/list/dae/anki/) Thank you! Feedback? * [GLT feedback form](https://frab.linuxtage.at/de/GLT18/public/events/355/feedback/new) * [admin@lukas-prokop.at](mailto:admin@lukas-prokop.at)