Transformer-based English–Chinese Machine Translation & Attention Visualizer

A Transformer built from scratch — no nn.Transformer — with its attention laid bare.

Overview

A from-scratch implementation of the Transformer architecture — scaled dot-product attention, multi-head attention, positional encoding, and a full Encoder/Decoder, all hand-built rather than assembled from PyTorch's built-in nn.Transformer. It's trained on a large English–Chinese parallel corpus using custom byte-pair-encoding (BPE) tokenizers for each language.


The Web Demo


Tech Stack

PyTorch, Flask, and custom BPE tokenizers for English and Chinese.