Monor commited on
Commit
8c33f89
1 Parent(s): c89cd35

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +59 -3
README.md CHANGED
@@ -1,3 +1,59 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TCMNER
2
+
3
+ # Model description
4
+
5
+ TCMNER is a fine-tuned BERT model that is ready to use for Named Entity Recognition of Traditional Chinese medicine and achieves state-of-the-art performance for the NER task. It has been trained to recognize six types of entities: prescription (方剂), herb (本草), source (来源), disease (病名), symptom (症状) and syndrome(证型).
6
+
7
+ Specifically, this model is a TCMRoBERTa model, a fine-tuned model of RoBERTa for Traditional Chinese medicine, that was fine-tuned on the Chinese version of the Haiwei AI Lab's Named Entity Recognition dataset.
8
+
9
+ **Currently, TCMRoBERTa is only a closed-source model for my own company, and I will open source it in the future.**
10
+
11
+
12
+ # How to use
13
+
14
+ You can use this model with Transformers pipeline for NER.
15
+
16
+ ```
17
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
18
+ from transformers import pipeline
19
+
20
+ tokenizer = AutoTokenizer.from_pretrained("Monor/TCMNER")
21
+ model = AutoModelForTokenClassification.from_pretrained("Monor/TCMNER")
22
+
23
+ nlp = pipeline("ner", model=model, tokenizer=tokenizer)
24
+ example = "化滞汤,出处:《证治汇补》卷八。。组成:青皮20g,陈皮20g,厚朴20g,枳实20g,黄芩20g,黄连20g,当归20g,芍药20g,木香5g,槟榔8g,滑石3g,甘草4g。。主治:下痢因于食积气滞者。"
25
+
26
+ ner_results = nlp(example)
27
+ print(ner_results)
28
+ ```
29
+
30
+
31
+ ## Training data
32
+
33
+ This model was fine-tuned on My own dataset.
34
+
35
+ Abbreviation|Description
36
+ -|-
37
+ O|Outside of a named entity
38
+ B-方剂 |Beginning of a prescription entity right after another prescription entity
39
+ I-方剂 | Prescription entity
40
+ B-本草 |Beginning of a herb entity right after another herb entity
41
+ I-本草 |Herb entity
42
+ B-来源 |Beginning of a soure of prescription right after another soure of prescription
43
+ I-来源 |Source entity
44
+ B-病名 |Beginning of a disease's name right after another disease's name
45
+ I-病名 |Disease's name
46
+ B-症状 |Beginning of a symptom right after another symptom
47
+ I-症状 |Symptom
48
+ B-证型 |Beginning of a syndrome right after another syndrome
49
+ I-证型 |Syndrome
50
+
51
+ # Eval results
52
+
53
+ ![alt text](images/iShot_2024-06-07_18.03.00.png "Title")
54
+
55
+
56
+ # Notices
57
+
58
+ 1. The moodel is commercially available for free.
59
+ 2. I am not going to write a paper about this model, if you use any details of this model in your paper, please mention it, thanks.