shibing624/bertspan4ner-base-chinese

🤗 Hugging Face 来源token-classificationapache-2.0823 MBother✓ 2 个校验和今天更新
一条命令提交

在你的模型文件夹旁边运行它。它会制作种子、将文件与 Hugging Face 比对,然后提交。你只需开始做种,并粘贴你账户中的密钥。它只读取你的文件,绝不修改。如果愿意,可以先阅读脚本。

curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo shibing624/bertspan4ner-base-chinese ./model-folder
需要做种者 →

BertSpan for Chinese Named Entity Recognition(bertspan4ner) Model

中文实体识别模型

bertspan4ner-base-chinese evaluate PEOPLE(人民日报) test data:

The overall performance of BertSpan on people test:

Accuracy Recall F1
BertSpan 0.9610 0.9600 0.9605

在PEOPLE的测试集上达到SOTA水平。

Usage

本项目开源在实体识别项目:nerpy,可支持bertspan模型,通过如下命令调用:

>>> from nerpy import NERModel
>>> model = NERModel("bertspan", "shibing624/bertspan4ner-base-chinese")
>>> predictions, raw_outputs, entities = model.predict(["常建良,男,1963年出生,工科学士,高级工程师"], split_on_space=False)
entities: [('常建良', 'PER'), ('1963年', 'TIME')]

模型文件组成:

bertspan4ner-base-chinese
    ├── config.json
    ├── model_args.json
    ├── pytorch_model.bin
    ├── special_tokens_map.json
    ├── tokenizer_config.json
    └── vocab.txt

训练数据集

中文实体识别数据集

数据集 语料 下载链接 文件大小
CNER中文实体识别数据集 CNER(12万字) CNER github 1.1MB
PEOPLE中文实体识别数据集 人民日报数据集(200万字) PEOPLE github 12.8MB

CNER中文实体识别数据集,数据格式:

美	B-LOC
国	I-LOC
的	O
华	B-PER
莱	I-PER
士	I-PER
我	O
跟	O
他	O

如果需要训练bertspan4ner,请参考https://github.com/shibing624/nerpy/tree/main/examples

Citation

@software{nerpy,
  author = {Xu Ming},
  title = {nerpy: Named Entity Recognition toolkit},
  year = {2022},
  url = {https://github.com/shibing624/nerpy},
}