Skip to content

Search quotes from games to see how an English word or idiom appears in the Japanese translation or vice versa.

License

Notifications You must be signed in to change notification settings

maxkagamine/Serifu.org

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

日本語 Serifu.org

Serifu.org is an open source language learning tool based on the idea that it’s easier to learn a language through something you’re interested in. Search over 300,000 quotes from video games to see how an English word or idiom appears in its Japanese translation or vice versa, using machine learning to highlight the relevant part of the translation. Inspired by Tatoeba and Reverso Context.

I started this project after realizing that, after going to the arcade nearly every day for a month to play Kancolle, I’d learned words like 魚雷ぎょらい and 軽空母けいくうぼ before I even knew the word for “sun.” Turns out, Zuihou is a better language teacher than any textbook!

Screenshots

Architecture diagram

Importers

Machine learning

  • Serifu.ML — The “matching word highlighting” shown below is accomplished using word alignment which you can read about and try for yourself here:

    When displaying results, the highlighted search terms are compared against precomputed alignments. If an alignment's search-language-side intersects with the highlight, its translation-language-side is also highlighted:

    Run docker run -it --rm -p 5000:5000 kagamine/word-alignment-demo to fire up the interactive visualizer (non-docker instructions in the above link) then click here to load in this quote.

    The Serifu.ML library is a C# implementation of that proof of concept and uses Python.NET, which I found rather interesting as it allows for executing Transformers/PyTorch in-process by directly interoping with the CPython runtime (also quite possibly the only appropriate use of the dynamic keyword I've encountered).

Frontend

  • Serifu.Web — Built using ASP.NET Core, Razor, TypeScript, and Vite. While I tend to work on React and Angular projects these days, I deliberately went old-school with MVC for this one in the interest of keeping it simple. That said, there are a number of modern web platform features in use here. Some interesting parts:

    Notes popup and link menu implemented with zero JavaScript using HTML popovers and anchor positioning:

    Cross-document view transitions conceal the full page navigation and make the app feel like a SPA despite being built like a regular website:

    Use of CSS grids for an adaptive mobile layout;

    Meticulous background size & position calculation using (bi)linear interpolation to keep Rin in frame and below the header (which also smoothly interpolates, as opposed to fixed breakpoints):

    And a slick search box loading animation:

License

Copyright © Max Kagamine

The programs in this repo are free software: you can redistribute and/or modify them under the terms of version 3 of the GNU Affero General Public License as published by the Free Software Foundation.

These programs are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.