Legacy Tools
Safe Privacy Detect / Specification
Safe Privacy Detect

A sensitive-information
classifier that runs on a CPU.

A small classification model that checks whether Japanese text explicitly states personal or sensitive information. It does not generate text.

This page records the specification and evaluation. Example verdicts and the setup steps are on the overview page; why I built the model is in a note. The permissions, storage and network use of the Legacy Tools extensions are published on the technical transparency page.

safe-privacy-detect-ja-70m / v0.2.0 / MIT / Japanese only
18.5ms

Time to judge one 200-character text (p50), measured on a development PC with 4 CPUs

4CPU

Designed for 4 CPUs and no GPU. No network needed at run time

About 70 million

70,157,586 parameters. The base model is sbintuitions/modernbert-ja-70m

6 × 3

For each of six categories, one of three labels and a probability

Features

Made for
Japanese text.

Safe Privacy Detect is a model built for Japanese text. Both the base model and the categories it judges are fitted to Japanese and to the Japanese context.

  • Foundation
    A Japanese base model.

    The base model is sbintuitions/modernbert-ja-70m, made for Japanese text only.

  • Categories
    Categories from the Japanese context.

    The six categories include information specific to Japan, such as the registered domicile (honseki, down to the municipality).

  • Abstain
    It does not assume what is not written.

    Sentences with an unclear subject, indirect wording, hearsay or guesswork, masked text. When the text alone cannot settle it, it returns ABSTAIN.

Input

Just the text.

Pass it Japanese text. Mainly a single chat message (up to 200 characters); up to 800 characters are accepted. Texts over 200 characters are best split by the caller and sent in parts.

Output

A label and a probability per category.

{"name": {"status": "NOT_DETECTED", "probabilities": {...}},
 "health": {"status": "DETECTED", ...}, ...}

It does not return which part of the text matched. The text itself is not written to the output or to any log.

The six categories

name
Name (both the surname and the given name)
health
Health and medical care, medical history, disability (including results such as health check-ups, and medical treatment and dispensing)
crime
Criminal history, criminal proceedings, juvenile protection proceedings
honseki
Registered domicile (honseki, down to the municipality)
union
Trade union membership
belief
Beliefs (limited to explicit statements of religious or political views)

The three labels

DETECTEDThe content of the category is explicitly stated about a person in the text.
NOT_DETECTEDNot explicitly stated. This includes general statements, product descriptions, figures of speech, statements about organisations, and anything that could only be inferred.
ABSTAINThere is related wording, but the text alone cannot settle whether it is explicit (hearsay or guesswork, masked text, cut-off text, an unclear subject, or indirect wording).

The bundled script predict.py returns two further statuses: OUT_OF_SCOPE (an unsupported category ID, near-empty text, text in which less than 30% of the characters are Japanese, or text over 800 characters) and FAILED (a runtime error or a timeout; the default is 1,000 ms).

Speed (measured)

Speed on the development PC
Charactersp50p95Texts per second
507.5 ms10.6 ms129
10011.7 ms17.2 ms80
20018.5 ms24.8 ms52
40035.9 ms47.1 ms27
80063.5 ms78.7 ms15

Development PC (AMD Ryzen 7 5700X, WSL, limited to 4 CPUs), 200 runs per condition, 2026-11-23, v0.2.0. 32-bit ONNX, ONNX Runtime 1.23.2, 4 threads, one text at a time. Network time is not included. 3.7 seconds from start-up to the first response; peak resident memory about 1.25 GB.

On AWS (c7i.xlarge, 4 vCPUs, Tokyo region, 2026-11-24, v0.2.0): p50 26.1 ms and p95 29.2 ms at 200 characters, and p50 103.5 ms and p95 107.7 ms at 800 characters, which is over 100 ms. 4 vCPUs correspond to 2 physical cores, so it is slower than the development PC. Speed depends on the type and number of CPUs, so measuring again with the bundled bench.py is recommended.

Accuracy (evaluation)

35 of the 36 items meet their targets.The miss rate for union, 5.0% (8 of 159, 5.03%), does not reach the target of 5% or less.

Results by category
CategoryMiss rateFalse positives (ordinary)False positives (confusable)Abstain rateAbstain correctnessECE
name0.5%2.5%1.7%0.0%100.0%0.018
health3.7%0.1%10.0%0.1%93.9%0.005
crime3.0%0.1%3.3%0.1%87.8%0.002
honseki3.8%0.0%3.3%0.1%92.0%0.002
union5.0%0.1%0.0%0.2%91.5%0.007
belief4.4%0.0%0.0%0.1%93.6%0.003
Target5% or less3% or less10% or less10% or less70% or more0.05 or less

2026-11-23, 1,800 sentences, run once for this version. 32-bit ONNX, values after calibration. The evaluation set is synthetic, with sentences 6 to 110 characters long. The targets are proposals set by the developer.

Limits

  • It misses things. In the evaluation, 0.5–5.0% of sentences with an explicit statement were judged NOT_DETECTED. Do not design a system that relies on this model alone to stop leaks.
  • Confusable sentences produce false positives, especially for health (talk about medical insurance, medical professions, figures of speech and the like): 10%.
  • All training data is synthetic. Accuracy on real conversations may be lower than these values.
  • Accuracy on long sentences has not been checked. Training went up to 128 tokens (about 350 characters), and evaluation up to 110 characters.
  • The training and evaluation data were written to resemble exchanges at Japanese financial institutions. Other fields have not been measured.

What it does not do

  • It does not infer attributes (nationality from a name, an illness from a clinic, and so on).
  • It makes no legal judgement. The scope of its verdicts does not match legal definitions.
  • It does not decide whether text may be sent. Decisions and controls are up to the company that deploys it.
  • Things defined by their format, such as account numbers, My Number (Japan’s individual number), email addresses and phone numbers, are out of scope.
  • Race, social status, family origin, sex life, being a victim of crime, addresses and employers are not covered in this version.

What you need to run it

Environment4 CPUs, no GPU. No network at run time
SoftwarePython, onnxruntime 1.19 or later, transformers 4.48.0 or later, sentencepiece, protobuf, numpy
ContainerDockerfile included (based on python:3.10-slim)
Files18 files, about 544 MB (weights about 268 MB, ONNX about 268 MB). Two formats: safetensors and ONNX
LoadingThe standard transformers classification class. No custom code execution (trust_remote_code) is needed
LicenceMIT. No warranty

Want to try iton your own work?

We welcome questions about applying it to your work, and joint evaluation.

Enquiries are taken on the support page of legacy-tools.dev.

Ask us