ONNX Model Zoo

Anonym-IA/V2-camembert-ner-pii-onnx-fp32

By Anonym-IA · ↓ 10 · ♥ 1 · Updated 2026-01-19

What's in this repo

This page lists the files in Anonym-IA/V2-camembert-ner-pii-onnx-fp32, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 9 files, including 5 .json, 1 .md, 1 .onnx, 1 .model
  • Last updated 2026-01-19

ONNX files

File Size Download
onnx/model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

V2 CamemBERT-NER-PII French - ONNX FP32

Version ONNX FP32 du modèle CamemBERT-NER-PII V2 pour exécution dans le navigateur.

📦 Taille

  • Modèle ONNX FP32 : ~440 MB (précision maximale)
  • Mémoire requise : ~600 MB
  • Temps d'inférence : 200-500ms pour 512 tokens

🚀 Utilisation avec Transformers.js

Installation

npm install @huggingface/transformers

Code JavaScript

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, ... },
//   ...
// ]

Anonymisation côté client

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", ... }

📊 Performance navigateur

Testé sur :

  • ✅ Chrome/Edge (meilleur)
  • ✅ Firefox
  • ⚠️ Safari (plus lent)

Benchmarks (MacBook Pro M1) :

  • Temps de chargement : ~5-8 secondes
  • Inférence (256 tokens) : ~300ms
  • Mémoire utilisée : ~250 MB

🔧 Optimisations

Multi-threading

env.backends.onnx.wasm.numThreads = navigator.hardwareConcurrency || 4;

Cache du modèle

env.cacheDir = './.cache/transformers';

📄 Modèle PyTorch

Pour utilisation serveur (Python), voir le repo PyTorch :

Anonym-IA/V2-camembert-ner-pii-french

🔗 Liens

  • Modèle PyTorch : https://huggingface.co/Anonym-IA/V2-camembert-ner-pii-french
  • GitHub : Anonym-IA_LLM_Pseudonymisation
  • Transformers.js : https://huggingface.co/docs/transformers.js

Généré automatiquement le 2026-01-19 21:55:26

Model info

token-classification transformers.js
transformers.js onnx camembert token-classification fp32 browser named-entity-recognition fr dataset:TypicaAI/pii-masking-60k_fr license:mit region:us
↓ 10 ♥ 1

Created: 2026-01-19

Updated: 2026-01-19

View on Hugging Face

Files (9)

.gitattributes
README.md
added_tokens.json
config.json
onnx/model.onnx ONNX
sentencepiece.bpe.model
special_tokens_map.json
tokenizer.json
tokenizer_config.json

Related models