Instructions to use migranche/mask-camembert-ner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use migranche/mask-camembert-ner with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('token-classification', 'migranche/mask-camembert-ner');
mask-camembert-ner
Mixed-precision fp16 ONNX conversion of Jean-Baptiste/camembert-ner, with a tokenizer regenerated from the source repository's own SentencePiece model. Published for the public preview of mask, a French text redaction tool that runs in the browser.
The weights are not retrained or fine-tuned: this is a numerical format conversion of the source model.
Provenance
- Source: Jean-Baptiste/camembert-ner, revision
ef35fe7767c1dad71f5c853838cdd80d0b3441ed. - Licence: MIT, as declared by the source model card (
license: mit). The source repository contains no LICENSE file and no copyright notice naming a holder. The licences of the upstream base model (camembert-base) and of the training data (wikiner_fr) were not verified by us. - Converted from the source
model.onnx(SHA-256c9dfa2ec9e0bfad82d606782ba3e0ab94c001c46481514e0658fc20a624845c5).
Files
| File | Origin | SHA-256 |
|---|---|---|
onnx/model_fp16.onnx |
converted by us (see below) | 860504f2bf110f34ef7e28b78dbc7b6c2ed2af64a401e5c07b54415ce31958eb |
tokenizer.json |
regenerated by us from the source sentencepiece.bpe.model |
6898886e61473eeb34a66adb7f5e102ec4a8da3217701369320eb784f7415bfd |
tokenizer_config.json |
source repository, unchanged | a47e711439fb76c78b60929e8baa3a487a36b476c01886934d5dd2ec5d0c8f8f |
special_tokens_map.json |
source repository, unchanged | 645708b160268d79dbc31bc05bc93f77fda8dfd45dc806b5c3a86e17cfcc5a7a |
config.json |
source repository, unchanged | 17ec2dd3a642bfc839f3f94bd5ba2e996700aa69b06b3937b0e80b458b962207 |
The file name onnx/model_fp16.onnx follows the Transformers.js naming convention for dtype: 'fp16'. Inputs input_ids and attention_mask are int64; the output logits stays float32 (keep_io_types=True). Single file, no external data.
Conversion recipe
Fixed in writing before any conversion (mask, seuils.md, amendment (6)):
onnxconverter_common.float16.convert_float_to_float16(onnxconverter-common 1.16.0, onnx 1.23.2), in-memory call;keep_io_types=True;op_block_list= default list (DEFAULT_OP_BLOCK_LIST) +Pow,ReduceMean,Sqrt; other parameters at their defaults;- no pre-processing, no opset change (opset 11 kept).
Technical fix, without numerical effect: the to attribute of the /roberta/Cast node is set to FLOAT16 to match the declared type of its output; without it the file does not load (commit 29b6251).
Measured on mask's development set (17 synthetic French documents, onnxruntime-web WASM): 0 differing masks against the source model.onnx (commit 0b506fe). This is a small, indicative sample, not a guarantee of identical outputs on other texts.
Tokenizer
tokenizer.json is built from the source sentencepiece.bpe.model, tokenizer_config.json and special_tokens_map.json with CamembertConverter (transformers 5.20.2, tokenizers 0.23.3, sentencepiece 0.2.2). The build is reproducible (same SHA-256 on two runs).
Compared with Transformers.js 4.3.1 against the tokenizer of Xenova/camembert-ner (revision 8e1988247e872ba0137062653b1e5033a31e14fc) on the same 17 documents: 0 token-id differences out of 5,704, on full texts and word by word (commit 4411370, resultats/tokenizer/comparaison.md).
Intended use
Named-entity detection inside the public preview of mask, where every replacement is reviewed by a person before use. mask pins this repository by commit and is designed to verify each file's SHA-256 against its own manifest before use.
Limitations
- Labels are those of the source model only: PER, ORG, LOC, MISC. There is no label for addresses, phone numbers, e-mail addresses, IBANs, social security numbers or any other fixed-format data.
- This model is not, on its own, a personal-data detector, and it does not guarantee any anonymisation. A text processed with it may still contain personal data.
- French only; behaviour on other languages was not evaluated.
- The fp16 conversion changes the numerical precision; equivalence with the source model was measured only on the small sample above.
- Downloads last month
- 66
Model tree for migranche/mask-camembert-ner
Base model
Jean-Baptiste/camembert-ner