monju-mask-ja-02
protecting personal data on CPU
2 min readupdated
The monju-mask-ja-02 model is designed to find and hide personally identifiable information (PII) in Japanese texts. It is a follow-up to the monju-mask-ja-01 project, which first determines the document type and then selects the most appropriate detector. The solution runs locally on a CPU without contacting cloud servers and is suitable for preliminary data cleanup before sending it to AI models. The total file size is 320 MB, and the CC BY-SA 4.0 license permits commercial use.
Key features
- Flexible routing: the system analyzes the text format and length to pass it to a specialized detector or a classical ensemble.
- CPU operation: high processing speed (about 14 ms per document) allows using the model on regular hardware without a GPU.
- Eight categories: recognition of names, addresses, emails, phone numbers, dates, account/ID numbers, URLs, and credentials.
- Contextual filtering: built-in analysis helps reduce the number of false positives in standard business documents.
What you can do
- Secure processing: clean client documents of personal data on a local computer before transferring them to external LLMs.
- Pipeline integration: embed the masking tool into text pipelines based on Python or via the Toramon Mask utility.
- Japanese text analysis: process various document formats with automatic selection of the optimal recognition algorithm.
Example
Running text verification using the Python library:
from toramon.adapters.monju_genre import load_monju_genre
filt = load_monju_genre("models/monju-mask-ja-02", threads=4)
print(filt.redact("山田太郎様の電話は090-1234-5678です。").redacted_text)
# → [PERSON_1]様の電話は[PHONE_1]です。Read more
Details• Accuracy (strict F1): 95.32% on business documents, up to 99.00% on Sumi tests.
• Hardware: runs entirely on CPU, GPU not required.
• Dependencies: numpy, onnxruntime, tiktoken, xgboost, python-crfsuite.
• Limitations: does not provide 100% anonymity guarantee, some personal data (about 11%) may be missed.










Comments