Downloads · 30 days
494
66% of all-time downloads
Anonym-IA/V2-camembert-ner-pii-onnx-int8
V2-camembert-ner-pii-onnx-int8 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 INT8 quantifiée du modèle CamemBERT-NER-PII V2 optimisée pour navigateurs et appareils mobiles.
Downloads · 30 days
494
66% of all-time downloads
All-time downloads
749
Public
Repo size
113 MB
Likes
0
Public
Click a slice to open those files.
.onnx112 MB · 97%
From the Hugging Face model README
Version ONNX INT8 quantifiée du modèle CamemBERT-NER-PII V2 optimisée pour navigateurs et appareils mobiles.
| Caractéristique | INT8 (Ce modèle) | FP32 |
|---|---|---|
| Taille | ~110 MB ✅ | ~440 MB |
| Vitesse chargement | ~2-3s ✅ | ~6-10s |
| Mémoire utilisée | ~200 MB ✅ | ~600 MB |
| Précision | ~70-80% ⚠️ | 100% |
| Scores confiance | ~50-60% ⚠️ | ~95-98% |
| Usage recommandé | Navigateurs (contraintes) | Serveurs, précision |
npm install @huggingface/transformers
import { pipeline, env } from '@huggingface/transformers';
// Configuration optimale
env.backends.onnx.wasm.numThreads = 4;
// Charger le modèle ONNX INT8 quantifié
const ner = await pipeline(
'token-classification',
'Anonym-IA/V2-camembert-ner-pii-onnx-int8',
{ quantized: true } // Important pour INT8
);
// 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.94, ... },
// { entity_group: 'NOM_PERSONNE', word: 'Dupont', score: 0.91, ... },
// ...
// ]
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) :
Benchmarks (Windows Desktop i7) :
env.backends.onnx.wasm.numThreads = navigator.hardwareConcurrency || 4;
env.cacheDir = './.cache/transformers';
// Utilise GPU navigateur pour accélération matérielle
env.backends.onnx.executionProviders = ['webgpu', 'wasm'];
⚠️ RECOMMANDATION : Privilégiez FP32 sauf contraintes strictes de taille
Utilisez INT8 UNIQUEMENT si :
Utilisez FP32 (recommandé) si :
Anonym-IA/V2-camembert-ner-pii-french
Anonym-IA/V2-camembert-ner-pii-onnx-fp32
Identiques au modèle PyTorch :
Généré automatiquement le 2026-01-19 21:55:37