shibing624 commited on
Commit
5349ae3
1 Parent(s): 2e7983a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +84 -1
README.md CHANGED
@@ -1,3 +1,86 @@
1
  ---
2
- license: apache-2.0
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - zh
4
+ tags:
5
+ - bert
6
+ - pytorch
7
+ - zh
8
+ - ner
9
+ license: "apache-2.0"
10
  ---
11
+
12
+ # BERT for Chinese Named Entity Recognition(bert4ner) Model
13
+ 中文实体识别模型
14
+
15
+ `bert4ner-base-chinese` evaluate PEOPLE(人民日报) test data:
16
+
17
+ The overall performance of BERT on people **test**:
18
+
19
+ | | Accuracy | Recall | F1 |
20
+ | ------------ | ------------------ | ------------------ | ------------------ |
21
+ | BertSpan | 0.9610 | 0.9600 | 0.9605 |
22
+
23
+ 在PEOPLE的测试集上达到SOTA水平。
24
+
25
+ ## Usage
26
+
27
+ 本项目开源在实体识别项目:[nerpy](https://github.com/shibing624/nerpy),可支持bert4ner模型,通过如下命令调用:
28
+
29
+ ```shell
30
+ >>> from nerpy import NERModel
31
+ >>> model = NERModel("bert", "shibing624/bertspan4ner-base-chinese")
32
+ >>> predictions, raw_outputs, entities = model.predict(["常建良,男,1963年出生,工科学士,高级工程师"], split_on_space=False)
33
+ entities: [('常建良', 'PER'), ('1963年', 'TIME')]
34
+ ```
35
+
36
+ 模型文件组成:
37
+ ```
38
+ bertspan4ner-base-chinese
39
+ ├── config.json
40
+ ├── model_args.json
41
+ ├── pytorch_model.bin
42
+ ├── special_tokens_map.json
43
+ ├── tokenizer_config.json
44
+ └── vocab.txt
45
+ ```
46
+
47
+
48
+ ### 训练数据集
49
+ #### 中文实体识别数据集
50
+
51
+
52
+ | 数据集 | 语料 | 下载链接 | 文件大小 |
53
+ | :------- | :--------- | :---------: | :---------: |
54
+ | **`CNER中文实体识别数据集`** | CNER(12万字) | [CNER github](https://github.com/shibing624/nerpy/tree/main/examples/data/cner)| 1.1MB |
55
+ | **`PEOPLE中文实体识别数据集`** | 人民日报数据集(200万字) | [PEOPLE github](https://github.com/shibing624/nerpy/tree/main/examples/data/people)| 12.8MB |
56
+
57
+
58
+ CNER中文实体识别数据集,数据格式:
59
+
60
+ ```text
61
+ 美 B-LOC
62
+ 国 I-LOC
63
+ 的 O
64
+ 华 B-PER
65
+ 莱 I-PER
66
+ 士 I-PER
67
+ 我 O
68
+ 跟 O
69
+ 他 O
70
+ ```
71
+
72
+
73
+ 如果需要训练bertspan4ner,请参考[https://github.com/shibing624/nerpy/tree/main/examples](https://github.com/shibing624/nerpy/tree/main/examples)
74
+
75
+
76
+ ## Citation
77
+
78
+ ```latex
79
+ @software{nerpy,
80
+ author = {Xu Ming},
81
+ title = {nerpy: Named Entity Recognition toolkit},
82
+ year = {2022},
83
+ url = {https://github.com/shibing624/nerpy},
84
+ }
85
+ ```
86
+