An encoding oriented semantic validation benchmark.
This repo is mainly used for semantic encoding validation for short CJK texts (SemVal-S). And StruVal-C can be found at Janus.
All Simplified Chinese data used in LGBench are derived from the THUOCL. The Traditional Chinese, Japanese, and Korean datasets were automatically translated from Simplified Chinese data using GPT-4o, followed by minimal manual verification.
The Language-Gibberish Dataset Statistics:
| Encoding | Positive Samples (pos) |
Negative Samples (neg) |
|---|---|---|
| GBK | 15,691 | 51,246 |
| Big5 | 10,200 | 43,349 |
| EUC-KR | 15,629 | 28,632 |
| EUC-JP | 15,555 | 32,185 |
| Shift-JIS | 15,538 | 24,336 |
-
First download a Qwen family model (recommended: Qwen3-0.6B or Qwen2.5-0.5B on ModelScope):
modelscope download --model Qwen/Qwen3-0.6B --local_dir ./your_dir # or modelscope download --model Qwen/Qwen2.5-0.5B --local_dir ./your_dir -
Configure the model path: set
model_pathto the absolute path of your model directory inconfig.json.{"model_path": "C:\\your_path\\qwen2-0.5b"} -
Run
uv run main.py --model <model_name> --bytes <byte_sequence> --enc <encoding> # --model: qwen2.5 | qwen3 # --bytes: \x... # --enc : gbk | big5 | euc-kr | euc-jp | shift-jis
Each byte must be written as
\xfollowed by two hex digits!# example uv run main.py --model qwen2.5 --bytes "\xcf\xc2\xb5\xa5" --enc gbk # output: # decode text: 下单 # SemVal-S result: True
benches/
├── charset_normalizer/
│ └── run.py
├── nxe/
│ └── run.py
├── ppl/
│ └── run.py
└── prompt/
└── run.py
To run any benchmark test, simply execute the run.py script inside its corresponding subdirectory.
Note:
promptuses the Ollama API to get stable, structured outputs and control temperature.


