HuggingFace镜像/bert-large-uncased-finetuned-ner
模型介绍文件和版本分析

bert-large-uncased-finetuned-ner

该模型是 [bert-large-uncased] 在 conll2003 数据集上的微调版本。 它在评估集上取得了以下结果:

  • 损失:0.0778
  • 精确率:0.9505
  • 召回率:0.9575
  • F1 值:0.9540
  • 准确率:0.9886

模型描述

需要更多信息

局限性与偏差

此模型受限于其训练数据集,该数据集包含特定时间段内带有实体标注的新闻文章。对于不同领域的所有使用场景,其泛化能力可能不佳。此外,该模型偶尔会将子词标记为实体,可能需要对结果进行后处理以处理这些情况。

如何使用

您可以将此模型与 openmind 的 NER pipeline 配合使用。

from openmind import pipeline
from openmind  import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("Changchun_Ascend/bert-large-uncased-finetuned-ner")
model = AutoModelForTokenClassification.from_pretrained("Changchun_Ascend/bert-large-uncased-finetuned-ner")
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
example = "My name is Scott and I live in Ohio"
ner_results = nlp(example)
print(ner_results)

{'entity': 'B-PER', 'score': 0.99951184, 'index': 4, 'word': 'scott', 'start': 11, 'end': 16}, {'entity': 'B-LOC', 'score': 0.9999815, 'index': 9, 'word': 'ohio', 'start': 31, 'end': 35}

训练过程

训练超参数

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

  • 学习率(learning_rate):2e-05
  • 训练批次大小(train_batch_size):16
  • 评估批次大小(eval_batch_size):64
  • 随机种子(seed):42
  • 优化器(optimizer):Adam,参数 betas=(0.9,0.999),epsilon=1e-08
  • 学习率调度器类型(lr_scheduler_type):线性
  • 训练轮数(num_epochs):10

训练结果

训练损失轮次步数验证损失精确率召回率F1值准确率
0.19971.08780.05760.93160.92570.92860.9837
0.042.017560.04900.94000.95130.94560.9870
0.01993.026340.05570.94360.95400.94880.9879
0.01124.035120.06020.94430.95690.95060.9881
0.00685.043900.06310.94510.95890.95200.9882
0.00446.052680.06380.95100.95670.95380.9885
0.0037.061460.07220.94950.95600.95270.9885
0.00168.070240.07620.94910.95950.95430.9887
0.00189.079020.07690.94960.95420.95190.9883
0.000910.087800.07780.95050.95750.95400.9886
下载使用量0