< Blog

anki-zh: Making Mandarin sentences stick to memory

I have been learning Mandarin Chinese, and one of the recurring problems is not finding material: there is an effectively unlimited amount of Chinese to read and listen to. The problem is deciding what should stay in memory, and then making sure it actually does. Naturally, the web is filled with conversation guides (mainly books). But Chinese pronunciation is exceptionally difficult since one needs to memorize easily dozens of different syllables with their four tones (although some syllables do not appear naturally in all four tones).

I already use Anki for spaced repetition. But creating Chinese cards manually has enough friction that I often do not create the card at all, or stop repeating them after a while out of annoyance. I wanted a workflow where I could encounter a useful sentence, put it into Anki, generate good audio, and continue studying and memorizing how that sentence is supposed to be vocalized. .

So I built anki-zh, a small Anki add-on for learners of Mandarin Chinese.

The main idea of Anki-zh

The add-on focuses on learning entire sentences to be used in conversation, so we start from a sentence rather than from a vocabulary list.

Consider the sentence "我最近开始学中文" which means roughly "I recently started studying Chinese". What the extension does is generate audio for the sentence using neural models from Microsoft Edge TTS, allow the user to regulate the pronunciation speed, and then add them to the current Anki deck for spaced repetition.

The add-on also has settings for the text-to-speech voice (if one prefers a male or female voice), the content shown on the front and back of the card, and whether an inverse card should be created. The inverse version is useful because it changes the direction of recall: instead of seeing Chinese first, I can hear the sentence and try to recover the written Chinese. This is useful since Chinese has many words with the same pronunciation but very different meaning, which needs to eb inferred from context.

As i said above Audio is generated using Microsoft Edge text-to-speech. The dependencies required for TTS are downloaded the first time the add-on is used (generally, it should take one or two minutes at most, since models are actually executed remotely).

Why Anki?

Anki is easy to underestimate because its interface is built around something that looks almost trivial: a question, an answer, and a schedule.

But the scheduling is the important part. After each review, Anki uses your response to decide when the card should appear again. Material that is easy can be pushed further into the future, while material that is forgotten returns sooner. The point is not to review everything constantly. The point is to spend reviews where memory needs them.

The Anki manual describes the system in terms of active recall and spaced repetition: try to retrieve an answer from memory, then revisit it across increasingly distributed intervals.

For language learning this is particularly useful because fluency depends on a large amount of information becoming inexpensive to retrieve. If every word, construction, and sound requires a deliberate lookup, understanding a sentence becomes slow. Some knowledge needs to be available directly.

Michael Nielsen and memory as a tool

A major influence on how I think about Anki is Michael Nielsen's essay Augmenting Long-term Memory.

Nielsen's argument is more interesting than simply saying that flashcards are effective. He treats a personal memory system as a cognitive tool: something that changes what it is practical to learn and retain over long periods.

One of the central ideas in the essay is that memory can become intentional. Normally we read, understand something for a moment, and hope enough of it survives. With a spaced-repetition system, we can make an explicit decision that a piece of knowledge is worth retaining.

As we encounter something useful, with Anki we reduce the problem of remembering it into a sequence of understanding it, turning it into a retrieval problem, scheduling it and keeping it available to us through spaced repetition.

Nielsen also makes a point I think is especially important: making cards is itself part of learning. Choosing what to ask, deciding what belongs in the answer, and splitting a vague idea into precise questions forces you to inspect what you actually understand.

This is one reason I do not want anki-zh to become a button that manufactures thousands of generic Chinese cards automatically.

The useful workflow is almost the opposite. I encounter a sentence that matters to me, decide that I want to remember it, and make that sentence cheap to add to the memory system.

Reducing the cost of making good cards

There is a practical tension in Anki.

Good cards are personal, but personal cards take time to create.

If creating a card means copying the sentence, opening another application, generating audio, downloading the audio file, attaching it to the note, adjusting the fields, and finally returning to Anki, then even a useful sentence may not survive the process.

That is the problem I wanted the add-on to remove. The automation is deliberately around the mechanical work, not the intellectual decision: the computer should generate the audio and construct the Anki note. I should still decide which sentence deserves to enter my deck.

Why sentences and not vocabularies or character?

Isolated vocabulary cards are useful, but Mandarin is not a dictionary lookup exercise. A word is encountered inside syntax, collocations, particles, aspect, tone patterns, and especially context.

This does not mean every card should test all of these things simultaneously. Nielsen argues for making many Anki questions as atomic as possible: if a card repeatedly fails, it is often better to split the knowledge into smaller retrieval tasks.

Recognition and production are different

Anki itself distinguishes notes from cards. A single note can generate multiple cards which test the same underlying information in different directions. Its manual uses foreign-language learning as a standard example: recognizing a foreign word and producing it are different retrieval tasks, so they should not necessarily share the same review history.

That is also why I added the optional inverse card to anki-zh. The ability to mentally map spoken Chinese to text and to pronounce it back are very different. I may recognize a sentence instantly when it is written and still fail to parse it at normal speaking speed.

Giving audio its own retrieval direction makes that failure visible.

Audio matters more in Chinese

Mandarin has another complication: knowing a written form does not imply that the corresponding sound is stable in memory.

Characters do not transparently encode pronunciation in the way an alphabetic spelling system often does. On top of that, tones are lexical information. Remembering the rough sequence of consonants and vowels is not enough.

For that reason I wanted generated speech to be part of the card-creation workflow rather than an optional cleanup step performed later.

The preview step matters too. Text-to-speech is useful, but it should still be checked before the card is committed. The add-on therefore lets me play the generated sentence and adjust playback speed before adding it.

Anki should support a project, not become the project

One of Nielsen's observations I like most is that Anki works particularly well when it serves some larger activity. In his essay, he describes using it while learning enough reinforcement learning to understand the AlphaGo literature. The cards were not the final objective; they supported a concrete intellectual project.

I think the same principle applies to language learning.

The objective is not to have a beautiful deck with a large card count. The objective is to read, listen, speak, and understand Chinese. Anki is infrastructure underneath that process.

This also argues against importing enormous collections of sentences merely because they are available. Nielsen calls disconnected cards "orphan questions": material with too little connection to the rest of what you are doing. Such cards may be technically learnable while still being poor uses of attention.

A sentence I heard in a conversation, found in a book, struggled with in a video, or needed to express myself has an existing network of associations. That makes it much more interesting than a random sentence selected only because it contains an HSK word.

Conclusion

I started this as a small convenience tool, but the interesting part is the boundary it exposes between software and learning.

I believe that there are two very different things we can automate. Firstly, we can automate the mechanical work of learning (generating the audio, creating the note populating the Anki fields, etc...). Then, we can automate intellectual work: deciding what matters, understanding the difficult parts we struggle most to learn and also retrieval itself.

Automating the first category makes sense because it reduces friction, while automating the second category too aggressively can remove exactly the cognitive work that makes a good card valuable.

This is where Nielsen's essay continues to be useful and interesting. A memory system is not simply a database into which we pour information. It is a tool for controlling what becomes cognitively available to us. The quality of the selection and the quality of the retrieval questions matter.

For me, anki-zh is an attempt to make that selection process easier without removing it. I still choose the sentence. I still decide that it is worth remembering. The software handles the repetitive part and hands the result to Anki's scheduler.

The goal is simple: when I find a useful piece of Chinese today, I want a low-friction way to make it part of the Chinese I can still understand months from now.

References