Downloads · 30 days
260
19% of all-time downloads
Anonym-IA/V2-camembert-ner-pii-onnx-fp32
V2-camembert-ner-pii-onnx-fp32 is a token classification model from Anonym-IA. Use it when you need labels on individual words, such as names. It is set up for transformers.js. The card lists the license as mit.
Version ONNX FP32 du modèle CamemBERT-NER-PII V2 pour exécution dans le navigateur.
Downloads · 30 days
260
19% of all-time downloads
All-time downloads
1.4K
Public
Repo size
446 MB
Likes
1
Public
Click a slice to open those files.
.onnx445 MB · 99%
From the Hugging Face model README
Version ONNX FP32 du modèle CamemBERT-NER-PII V2 pour exécution dans le navigateur.
npm install @huggingface/transformers
import { pipeline, env } from '@huggingface/transformers';
// Configuration optimale
env.backends.onnx.wasm.numThreads = 4;
// Charger le modèle ONNX FP32
const ner = await pipeline(
'token-classification',
'Anonym-IA/V2-camembert-ner-pii-onnx-fp32'
);
// Détecter les PII
const text = "Jean Dupont habite au 12 rue de la Paix, 75001 Paris";
const entities = await ner(text, { aggregation_strategy: 'simple' });
console.log(entities);
// [
// { entity_group: 'PRENOM_PERSONNE', word: 'Jean', score: 0.95, ... },
// { entity_group: 'NOM_PERSONNE', word: 'Dupont', score: 0.92, ... },
// ...
// ]
async function anonymizeInBrowser(text) {
const entities = await ner(text, { aggregation_strategy: 'simple' });
let anonymized = text;
const mapping = {};
const counters = {};
// Tri par position décroissante
entities.sort((a, b) => b.start - a.start);
for (const entity of entities) {
const type = entity.entity_group;
counters[type] = (counters[type] || 0) + 1;
const marker = `[${type}${counters[type]}]`;
mapping[marker] = entity.word;
anonymized = anonymized.slice(0, entity.start) +
marker +
anonymized.slice(entity.end);
}
return { anonymized, mapping };
}
// Utilisation
const result = await anonymizeInBrowser(
"Jean Dupont habite au 12 rue de la Paix, 75001 Paris"
);
console.log(result.anonymized);
// "[PN1] [NOM1] habite au [NUM1] [VOIE1], [CP1] [VI1]"
console.log(result.mapping);
// { "[PN1]": "Jean", "[NOM1]": "Dupont", ... }
Testé sur :
Benchmarks (MacBook Pro M1) :
env.backends.onnx.wasm.numThreads = navigator.hardwareConcurrency || 4;
env.cacheDir = './.cache/transformers';
Pour utilisation serveur (Python), voir le repo PyTorch :
Anonym-IA/V2-camembert-ner-pii-french
Généré automatiquement le 2026-01-19 21:55:26