GameSentenceMiner: Learning and Sentence Mining from Video Games and Visual Novels

I’m the creator of a free, open-source tool that helps automate the creation of context-rich flashcards from video games that include sentence audio, screenshots, context-aware translations, and more. You can see examples of a couple flashcards at the bottom of this post.

Before I get into GSM, let me answer a few leading questions.

Why Learn from Games?

A few reasons:

  • Video games are HUGE in Japan, with no sign of slowing down anytime soon. There will always be an endless supply of games for whatever style you enjoy.
  • Video games carry cultural significance in Japan, and learning from them can lead to interesting conversations with prospective Japanese friends.
  • Understanding the language is often necessary to complete a game. Only loosely following the story usually isn’t enough.
  • Video games are, by design, at your own pace.

Why Learn from Visual Novels?

I’m not a huge fan of Visual Novels personally, but there are undeniable benefits to using them for learning Japanese:

  • Even more "at your own pace" than games.
  • A good mix of dialogue and narration.
  • Very easy to extract text with tools like Textractor.

What is Sentence Mining, and Why Should I Do It?

Sentence Mining, simply put, is a language-learning method where you collect real example sentences (from books, shows, games, etc.) and study them to learn vocabulary and grammar in context. The most common form of Sentence Mining is creating Anki flashcards via Yomitan or similar tools.

Sentence Mining is absolutely not required to learn Japanese or any other language, but here are a few reasons why I think it’s beneficial:

  • Reviewing vocabulary you’ve learned through immersion increases the likelihood you’ll recognize it the next time you encounter it. This reduces friction while playing.
  • It’s a lot more fun to re-listen to audio from the games you’ve played than to review example sentences in pre-made decks.
  • If you like discussing your learning journey with others, having examples of vocab you’ve mined—with context—is extremely convenient.
  • Above all, it helps you retain the personal connection you have with the content you’ve enjoyed.

How to Mine from Games?

Many of you may be familiar with clunky ShareX workflows, but for me, it was either never make flashcards from games or build something custom—and I think it’s clear which option I chose.

GSM (GameSentenceMiner)

Here’s a quick guide on how to get started with Sentence Mining using GSM:

1. Install and Set Up Anki

  • Download and install Anki on your computer.
  • Set up a new profile or use an existing one.
  • Import a deck for an Example Card Template. I recommend Lapis, which GSM is pre-configured for.
  • Install AnkiConnect.

2. Install and Set Up Yomitan

Yomitan is a browser extension that allows you to look up Japanese words instantly by hovering over them. It also has built-in flashcard creation, making it perfect for Sentence Mining.

  • Download and install Yomitan in your browser of choice.
  • Import one or more dictionaries (JMdict, Jittendex, Kanjidic, etc.) so you can get definitions on hover.
  • Configure Anki integration in the settings if you want one-click card creation. If using Lapis, follow the instructions here.

3. Install GSM

  • Download and install GameSentenceMiner.
  • Follow the setup instructions in the Wiki, or follow this video guide: https://www.youtube.com/watch?v=sVL9omRbGc4
  • Launch GSM and open the texthooker page at localhost:55000/texthooker.
  • Linux and Mac are also technically supported but require a bit more setup that I won't go into here.

4. Get Text from Games

There are a few ways to capture Japanese text from games, depending on what type of game you’re playing:

  • Agent – Agent is a tool that can capture text directly from supported games. You can find a list of supported games here. GSM will see the clipboard output of Agent automatically, or you can Enable Websocket Server to allow Text to feed into GSM without touching clipboard.
  • Textractor – A lot of VNs can be hooked into with Textractor. Textractor also outputs to clipboard, but optionally you can install an extension that GSM is pre-configured for.
  • GSM's OCR (Optical Character Recognition) – For text that can’t be hooked (e.g., pre-rendered subtitles or text in images). GSM has its own OCR that has been carefully designed to provide clean output from games, while maintaining a high level of accuracy for Screenshots and Sentence Audio.

Between these three methods, you can capture text from virtually any game.

5. Make Flashcards with Yomitan + GSM

Once the text is flowing into GSM, you can see it in GSM's texthooker page that opens automatically at localhost:55000/texthooker:

  • Hover over the sentence in Yomitan to look up words you don’t know.
  • Click the “+” button in Yomitan to create a flashcard. GSM will automatically add:
    • An audio clip of the voice line (if available).
    • A screenshot from the game.
    • Optional context-aware translations.
  • Review these cards in Anki as part of your regular study routine.

The end result is a flashcard that doesn’t just teach you a word—it drops you right back into the moment you learned it, with audio and visuals from the game.

GSM Also:

  • Has an Overlay that comes with Yomitan included to allow for On-screen lookups in game.
  • Allows you to combine voicelines for an even more context-rich card.
  • Provide Machine Translations in the Texthooker page (AI, Bring your own Key, local LLM also supported)
  • Lets you listen back to the voiceline (useful if you play a conventional game without an audio replay feature).
  • Optionally: Outputs a video trimmed around the voiceline.
  • Optionally: Outputs Video or Animated screenshot (avif) to your Anki note instead of a still image.
  • Optionally: Add Previous Sentence/Screenshot to your Anki Note (useful for Cloze type notes)

If you have any questions, let me know either here or on my Discord.

(Video) GSM OCR in Action

Example from Game: Sekiro

Example from VN: たねつみの歌

Quick Links

by Beannsss