ONNX 模型库
返回模型

说明文档

modernbert-ner-conll2003 (ONNX)

这是 IsmaelMousa/modernbert-ner-conll2003 的 ONNX 版本。它通过 这个 Hugging Face Space 自动转换并上传。

使用 Transformers.js

请参阅 token-classification 的管道文档:https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TokenClassificationPipeline


ModernBERT NER (CoNLL2003)

该模型是基于 answerdotai/ModernBERT-base 在 CoNLL2003 数据集上微调的命名实体识别 (NER) 模型。

在识别人物组织地点的任务中表现稳健。

在评估集上取得以下结果:

  • Loss: 0.0992
  • Precision: 0.8349
  • Recall: 0.8563
  • F1: 0.8455
  • Accuracy: 0.9752

模型详情

训练数据

该模型在 CoNLL2003 数据集上微调,这是 NER 领域知名的基准数据集。 该数据集为模型在通用英文文本上的泛化能力提供了坚实基础。

示例用法

以下是如何使用 Hugging Face Transformers 库调用该模型的示例:

from transformers import pipeline

ner = pipeline(task=\"token-classification\", model=\"IsmaelMousa/modernbert-ner-conll2003\", aggregation_strategy=\"max\")

results = ner(\"Hi, I'm Ismael Mousa from Palestine working for NVIDIA inc.\")

for entity in results:
    for key, value in entity.items():
        if key == \"entity_group\":
            print(f\"{entity['word']} => {entity[key]}\")

结果:

Ismael Mousa => PER
Palestine => LOC
NVIDIA => ORG

训练超参数

训练过程中使用了以下超参数:

  • learning_rate: 1e-06
  • train_batch_size: 8
  • eval_batch_size: 8
  • seed: 42
  • optimizer: 使用 adamw_torch,betas=(0.9,0.999),epsilon=1e-08,optimizer_args=无额外优化器参数
  • lr_scheduler_type: linear
  • num_epochs: 10

训练结果

Training Loss Epoch Step Validation Loss Precision Recall F1 Accuracy
0.2306 1.0 1756 0.2243 0.6074 0.6483 0.6272 0.9406
0.1415 2.0 3512 0.1583 0.7258 0.7536 0.7394 0.9583
0.1143 3.0 5268 0.1335 0.7731 0.7989 0.7858 0.9657
0.0913 4.0 7024 0.1145 0.7958 0.8256 0.8104 0.9699
0.0848 5.0 8780 0.1079 0.8120 0.8408 0.8261 0.9720
0.0728 6.0 10536 0.1036 0.8214 0.8452 0.8331 0.9730
0.0623 7.0 12292 0.1032 0.8258 0.8487 0.8371 0.9737
0.0599 8.0 14048 0.0990 0.8289 0.8527 0.8406 0.9745
0.0558 9.0 15804 0.0998 0.8331 0.8541 0.8434 0.9750
0.0559 10.0 17560 0.0992 0.8349 0.8563 0.8455 0.9752

框架版本

  • Transformers 4.48.0.dev0
  • Pytorch 2.2.1+cu121
  • Datasets 3.2.0
  • Tokenizers 0.21.0

onnx-community/modernbert-ner-conll2003-ONNX

作者 onnx-community

token-classification transformers.js
↓ 1 ♥ 0

创建时间: 2026-01-12 18:29:53+00:00

更新时间: 2026-01-12 18:30:04+00:00

在 Hugging Face 上查看

文件 (15)

.gitattributes
README.md
config.json
onnx/model.onnx ONNX
onnx/model_bnb4.onnx ONNX
onnx/model_fp16.onnx ONNX
onnx/model_int8.onnx ONNX
onnx/model_q4.onnx ONNX
onnx/model_q4f16.onnx ONNX
onnx/model_quantized.onnx ONNX
onnx/model_uint8.onnx ONNX
quantize_config.json
special_tokens_map.json
tokenizer.json
tokenizer_config.json