Thaki-LangMix-KoEn-0.7M
A lightweight language mixing detector for Korean and English
2 min read
This research checkpoint from ThakiCloud is a compact character-level classifier with just 684 thousand parameters (2.8 MB), designed for guardrail systems. The model analyzes text line by line to determine whether a Korean or English prompt contains segments in any other languages. The architecture runs on a CPU without a tokenizer, processing text at speeds of up to 4,350 lines per second. This solution is useful for developers of chatbots and input filtering systems who need to detect unwanted language mixing.
Key features
- Character tagger: tags each character by category (Korean, English, Chinese, Japanese, other languages) without a heavy tokenizer.
- High CPU speed: inference takes about 1 millisecond per line across 8 threads.
- Low false positive rate: 0.29% for English and 0.08% for Korean monolingual text.
- High recall: detects about 90% of mixed Korean and 87.5% of mixed English texts containing foreign language insertions.
What you can do
- Guardrail pipeline integration: embed into text service guardrails to check incoming Korean and English requests.
- Unwanted content filtering: automatically drop prompts containing foreign languages that violate service localization rules.
- Dataset analysis: use evaluation scripts to tag and filter large multilingual data corpora.
Example
from thaki_langmix import LangMix
# Загрузка чекпоинта и инициализация модели
m = LangMix("ckpt_cmtl.pt")
res = m.scan("회의 끝에 그는 je ne sais pas ce qu'il faut faire maintenant 이라고만 했다.")
print(res["flagged"]) # True
Read more
DetailsModel size: 684,655 parameters, checkpoint file 2.8 MB.
Hardware requirements: CPU-only, memory usage around 482 MB (mostly due to the PyTorch runtime).
Metrics on the ITEST21 test set: false positives 0.29% (EN) and 0.08% (KO); mixed text recall 90.35% (KO) and 87.53% (EN).
Limitations: short insertions in other Latin-based languages (XLAT) require at least 8 characters; input length limit is 512 characters.
Licenses: weights under CC BY-SA 4.0, code under MIT.










Comments