ytzfhqs commited on
Commit
452c4d7
·
verified ·
1 Parent(s): b3f4da3

Create README_ZH.md

Browse files
Files changed (1) hide show
  1. README_ZH.md +61 -0
README_ZH.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - Skywork/SkyPile-150B
5
+ - ticoAg/shibing624-medical-pretrain
6
+ - togethercomputer/RedPajama-Data-V2
7
+ - medalpaca/medical_meadow_wikidoc
8
+ - nlp-guild/medical-data
9
+ language:
10
+ - en
11
+ - zh
12
+ pipeline_tag: text-classification
13
+ ---
14
+ # fasttext-med-en-zh-identification
15
+ 该模型为[EPCD(Easy-Data-Clean-Pipeline)](https://github.com/ytzfhqs/EDCP)项目的中间产物,主要用来区分医疗预训练语料中中文与英文样本。模型框架使用[fastText](https://github.com/facebookresearch/fastText)。
16
+
17
+ # 数据组成
18
+
19
+ ## 中文通用预训练数据集
20
+ - [Skywork/SkyPile-150B](https://huggingface.co/datasets/Skywork/SkyPile-150B)
21
+ ## 中文医疗预训练数据集
22
+ - [ticoAg/shibing624-medical-pretrain](https://huggingface.co/datasets/ticoAg/shibing624-medical-pretrain)
23
+
24
+ ## 英文通用预训练数据集
25
+ - [togethercomputer/RedPajama-Data-V2](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-V2)
26
+ ## 英文医疗预训练数据集
27
+ - [medalpaca/medical_meadow_wikidoc](https://huggingface.co/datasets/medalpaca/medical_meadow_wikidoc)
28
+ - [nlp-guild/medical-data](https://huggingface.co/datasets/nlp-guild/medical-data)
29
+
30
+ 上述数据集均为高质量开源数据集,可以节省很多数据清洗的工作,感谢上述开发者对开源数据社区的支持!
31
+
32
+ # 数据清洗流程
33
+ - 数据集初步整理
34
+ - 对中文训练数据集,按`\n`分割预训练语料,去除开头和结尾可能存在的空格。
35
+ - 对英文训练数据集,按`\n`分割预训练语料,将所有字母全部变为小写,去除开头和结尾可能存在的空格。
36
+ - 统计词数量,具体的:
37
+ - 对中文,使用[jieba](https://github.com/fxsjy/jieba)包进行分词,并利用[jionlp](https://github.com/dongrixinyu/JioNLP)进一步过滤停用词和非中文字符。
38
+ - 对英文,使用[nltk](https://github.com/nltk/nltk)包进行分词,并利用内置停用词进行过滤。
39
+ - 根据词数量进行样本过滤,具体的(经验数值):
40
+ - 对中文:仅保留词数量大于5的样本。
41
+ - 对英文:仅保留词数量大于5的样本。
42
+ - 切分数据集,训练集比例为0.9,测试集比例为0.1。
43
+
44
+ # 模型表现
45
+ |Dataset | Accuracy |
46
+ |-------|-------|
47
+ |Train | 0.9994|
48
+ |Test | 0.9998|
49
+
50
+ ## Usage Example
51
+ ```python
52
+ import fasttext
53
+ from huggingface_hub import hf_hub_download
54
+
55
+ def to_low(text):
56
+ return text.strip().lower()
57
+
58
+ model_path = hf_hub_download(repo_id="ytzfhqs/fasttext-med-en-zh-identification", filename="model.bin")
59
+ model = fasttext.load_model('fasttext.bin')
60
+ model.predict(to_low('Hello, world!'))
61
+ ```