Rakshya 1.1

Rakshya finds personal data in Nepali, romanised Nepali, Hindi and English text and redacts it. It combines fixed-form rules for identifiers with a small token classification model. It needs no PyTorch, and the same model runs in Python and in a browser.

  • 40.8 MB 8-bit ONNX file, 160 MB of 32-bit weights
  • about 5 ms per sentence on a laptop CPU with four threads
  • 25 labels and two output profiles
  • Python package and a browser module
  • weights under Apache-2.0, code under MIT

This is version 1.1, the first whose weights carry a permissive licence. It has the labels, the rules, the code and the size of 1.0. What changed is the training: EverestNER, DanfeNER and CoNLL-2003, the three datasets that made 1.0 non-commercial, are gone from every place where they had been. On each test below it scores as 1.0 does or a little higher, and no difference between the two is larger than another draw of test texts would move.

The tag v1.0 keeps release 1.0 under CC BY-NC 4.0, and v0.2 and v0.1 keep the releases before it.

A lighter model, Rakshya 1.1 Lite, has 30 MB and takes 46 percent of the time per text in a browser. On the seven sets of real text it has 0.903 where this model has 0.913, on the practical test 0.948 where this model has 0.956, and on the 180 further cases 0.919 where this model has 0.960.

Quick start

# pip install git+https://github.com/fiste-ai/rakshya
from rakshya import Rakshya

pii = Rakshya()                     # fetches this tag once, then reads the local cache
text = "เคฎเฅ‡เคฐเฅ‹ เคจเคพเคฎ เคธเฅ€เคคเคพ เคฅเคพเคชเคพ เคนเฅ‹, เคซเฅ‹เคจ เฅฏเฅฎเฅชเฅงเฅจเฅฉเฅชเฅซเฅฌเฅญเฅค"

pii.find(text)                      # [(9, 18, 'PERSON'), (27, 37, 'PHONE')]
pii.find(text, labels="personal")   # personal data only
pii.redact(text)                    # เคฎเฅ‡เคฐเฅ‹ เคจเคพเคฎ [PERSON_1] เคนเฅ‹, เคซเฅ‹เคจ [PHONE_1]เฅค

From a local folder:

pii = Rakshya("folder/with/the/model/files")

The browser module is web/rakshya.js with the compiled module in web/pkg/. web/rakshya.js can also load the folder with transformers.js. A page that does this is live at fiste-ai.github.io/rakshya.

Files

File Content
onnx/model_quantized.onnx 8-bit model, 40.8 MB, the one the runtime loads
model.safetensors, config.json 32-bit weights, 160 MB
tokenizer.json, tokenizer_config.json Tokenizer, 48,000 pieces
tagger.json Version, labels, base model, weight file name
rakshya/ Python runtime
web/ Browser module, demo loader and WASM build
pyproject.toml Python package metadata
release.json SHA-256 of every package file
LICENSE.md, NOTICE.md Terms, third-party notices and training data

Labels

Label What it marks
PERSON Name of a person, including a surname or given name used alone later
LOCATION A place named for itself: country, province, district, city, ward, tole
ORGANIZATION A body: office, company, school, bank, hospital, party
DATE A date that is not a date of birth
ADDRESS Where a person lives, owns land or receives deliveries, as one span
DOB Date of birth
PHONE Personal or direct work phone number
EMAIL Personal or named work e-mail address
URL A web address
DIGITAL_SECRET Client IP address, device identifier, login or social handle, password, key, personal profile link
NATIONAL_ID Citizenship number, national identity number, Aadhaar, SSN, NINO, SIN and similar
TAX_ID Personal tax number: Nepal PAN, India PAN, ITIN, UTR, TFN
PASSPORT Passport number
DRIVER_LICENSE Driving licence number
VOTER_ID Voter or election identity number
MEDICAL_ID Patient, hospital record, health insurance or national health identity
EMPLOYEE_STUDENT_ID Staff number, provident fund number, permit, university registration, symbol number
PROPERTY_UTILITY_ID Plot, sheet, survey, ration card, electricity, water or fibre consumer number
ID_NUMBER Any other number that names one person
BANK_ACCOUNT Bank account, IBAN, DEMAT or BOID number
CREDIT_CARD Debit or credit card number
PAYMENT_ID UPI handle, wallet identity, payment handle, personal crypto address
VEHICLE_ID Vehicle registration plate of a private vehicle, chassis or VIN
OFFICE_PHONE Phone number of an office, helpline or public service
OFFICE_EMAIL Shared or institutional mailbox

Two profiles decide what is returned:

  • labels="all" returns every label.
  • labels="personal" returns personal data only. It leaves LOCATION, ORGANIZATION, DATE, URL, OFFICE_PHONE and OFFICE_EMAIL in the text, and also leaves a number that is already masked.

Evaluation

Measured with labels="personal" on the 380 rows of NepPIIBench, with the scorer that ships with the benchmark. Those rows are in no training or development row.

Language Rows Character precision Character recall Character F1 Exact precision Exact recall Exact F1
Nepali 130 0.9884 0.9894 0.9889 0.9621 0.9707 0.9664
Hindi 127 0.9759 0.9929 0.9843 0.9492 0.9663 0.9577
English 123 0.9764 0.9721 0.9743 0.9386 0.9460 0.9423
All 380 0.9801 0.9847 0.9824 0.9500 0.9610 0.9555

Character F1 counts overlapping characters, so a short boundary difference costs little. Exact F1 counts spans with the same start, end and label. On the same rows Rakshya 1.0 has an exact F1 of 0.9525 and a character F1 of 0.9826.

On the 837 strings that the benchmark marks as not personal, 44 were covered by a prediction, 5.3 percent. On the 15 rows with no personal data, 2 received a mark.

The model learned from the training part of the collection these rows are cut from, so this is a score on the kind of text it was trained for. Beside it stand seven sets of real news, web pages, government pages and comments, a larger practical test and 180 further cases:

Test Rakshya 1.1 Rakshya 1.0 1.1 ahead by, with its 95 percent interval
Seven sets of real text, 1,034 texts, mean exact F1 0.913 0.906 0.0072 (-0.0049 to 0.0202)
Practical test, 578 paragraphs, exact F1 with label 0.956 0.952 0.0042 (-0.0005 to 0.0093)
180 further cases, exact F1 with label 0.960 0.948 0.0122 (-0.0056 to 0.0362)

Each interval reaches below zero, so these tests do not tell the two versions apart: 1.1 is not behind 1.0, and it is not shown to be better. The interval comes from drawing the test texts again, the same ones for both versions.

All of these test sets were scored once before, by the models of release 1.0. The model of 1.1 and the rule that chose it were fixed before it was scored on them, it was scored once, and nothing was changed afterwards. Every score, beside those of 25 published systems, is in BENCHMARK.md.

Training data

The model is fine-tuned from nreimers/mMiniLMv2-L12-H384-distilled-from-XLMR-Large, with its vocabulary cut to the 48,000 pieces that Nepali, Hindi and English text use most. It learned from:

  • public named-entity and PII sets: IndicPHI, HiNER, Few-NERD, WNUT-17, Broad Twitter Corpus, Text Anonymization Benchmark, Nemotron-PII and Maskara;
  • text written by the templates of this project, in which every person, number and address is invented, with place names from nepali-canonical and the names of foreign people and places from ParaNames;
  • public news, web pages, government pages and comments in Nepali, Hindi and English, labelled for this project by an AI assistant under a written guide;
  • the training part of the practical corpus released as NepPIICorpus; its development part was used to choose and check settings, and its test part, published as NepPIIBench, was not read before the model was fixed;
  • more public news, web pages, government pages and comments without labels, labelled by a larger teacher model;
  • the tag probabilities of that teacher, a MuRIL model trained by us on the labelled text above.

None of the public sets is redistributed here. HiNER and Few-NERD are licensed CC BY-SA 4.0; the other sets are MIT or CC BY 4.0. The full list and the terms of each are in NOTICE.md.

What is no longer in it

Release 1.0 learned from EverestNER and DanfeNER, which are for non-commercial use, and from CoNLL-2003, which is for research use. In 1.1 none of the three is left in any of the five places where they had been: the training rows, the teacher, the labels of the machine-labelled text, the rows that choose when training stops, and the count that chose the vocabulary. The teacher was trained again without them, and it labelled the unlabelled text again.

Three things remain of them, none of which is data. The labelling guide follows the conventions of EverestNER where that set has a clear one, such as where a span ends. Earlier models that had learned from the three sets helped to pick which public texts were labelled for training. And where such a model disagreed with the labels of a text, a second pass looked at that text again; it decided by the guide and changed few.

Size and speed

Value
8-bit file 40.8 MB
32-bit weights 160 MB
Browser module 2.3 MB, 0.8 MB compressed
Median per sentence, 4 threads 5.2 ms
p95 per sentence, 4 threads 8.4 ms
Median per sentence, 1 thread 11.5 ms

Measured on Intel Core i5-13420H with ONNX Runtime, 21 tokens per sentence. In headless Chromium the 8-bit file gives the same spans as Python on every one of the 1,792 test texts, at about 46 ms per text of news with one thread.

Limits

  • It reads Nepali, romanised Nepali, Hindi and English. Other languages are out of scope.
  • Fixed-form rules cover Nepali and Indian identifiers best. Formats from other countries are found by the model and are less reliable.
  • Under labels="personal", only dates of birth are marked among dates. Other dates are returned as DATE under labels="all" and stay in the text under labels="personal".
  • An address is one span. A system that marks address parts one by one will differ at the boundaries.
  • The test sets are small. 380 evaluation rows support whole-set and per-language estimates, and per-label intervals on rare labels are wide.
  • This is a detector, not a legal compliance tool. Check its output before relying on a redaction.

Changes

  • 20 November 2026, code 1.1.1: Rakshya(model="lite") fetches Rakshya 1.1 Lite, and Rakshya(model="server") no longer asks for a model that this version does not have. The model files and the browser module are those of 1.1, and the Python package gave what the code of 1.1 gave on each of 9,546 texts under both profiles.

License

The model weights and the files that describe them are licensed under the Apache License, Version 2.0. The Python and browser code is licensed under the MIT License. See LICENSE.md and NOTICE.md, which names the training sets and their terms.

Citation

Fiste AI. Rakshya 1.1: personal data detection in Nepali, Hindi and English.
2026. https://huggingface.co/fiste-ai/rakshya
Downloads last month
111
Safetensors
Model size
39.9M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for fiste-ai/rakshya

Quantized
(4)
this model