• Stars
    star
    608
  • Rank 73,295 (Top 2 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SpaCy 中文模型 | Models for SpaCy that support Chinese

README written in English

SpaCy 官方中文模型已经上线(https://spacy.io/models/zh), 本项目『推动 SpaCy 中文模型开发』的使命已经完成,本项目将进入维护状态,后续更新将只进行 bug 修复,感谢各位用户长期的关注和支持。

SpaCy 中文模型

为 SpaCy 提供的中文数据模型. 模型目前还处于 beta 公开测试的状态 。

在线演示

基于 Jupyter notebook 的在线演示在 Binder

特性

部分 王小明在北京的清华大学读书 这个 Doc 对象的属性信息:

attributes_of_doc

NER (New!)

部分 王小明在北京的清华大学读书 这个 Doc 对象的 NER 信息:

ner_of_doc

开始使用

模型用二进制文件的形式进行分发, 用户应该具备基础的 SpaCy (version > 2) 的基础知识.

系统要求

Python 3 (也许支持 python2, 但未经过良好测试)

安装

下载模型

releases 页面下载模型 (New! 为中国地区的用户提供了加速下载的链接)。假设所下载的模型名为 zh_core_web_sm-2.x.x.tar.gz

安装模型

pip install zh_core_web_sm-2.x.x.tar.gz

为了方便后续在 Rasa NLU 等框架中使用,需要再为这个模型建立一个链接,by 执行以下命令:

spacy link zh_core_web_sm zh

运行完成后就可以使用 zh 这个别名来访问这个模型了。

运行 Demo 代码

Demo 代码位于 test.py. 在安装好模型后,用户下载或者克隆本仓库的代码,然后可以直接执行

python3 ./test.py

打开地址 http://127.0.0.1:5000, 将看到如下:

Dependency of doc

如何从零构造这个模型

workflow

语料库

本项目使用的语料库是 OntoNotes 5.0。

由于 OntoNotes 5.0 是 LDC (Linguistic Data Consortium) 的版权材料,无法直接包含在本项目中。好消息是,OntoNotes 5.0 对于 团体用户(包含企业和学术组织)是完全免费的。用户可以建立一个企业或者学术组织账号,然后免费获取 OntoNotes 5.0。

TODO list

  • 属性 pos_ 不正确. 这个和 SpaCy 中中文语言 Class 相关。
  • 属性 shape_ and is_alpha 似乎对中文并无意义, 但需要权威信息确认一下.
  • 属性 is_stop 不正确. 这个和 SpaCy 中中文语言 Class 相关。
  • 属性 vector 似乎没有训练的很好。
  • 属性 is_oov 完全错误. 第一优先级修复。
  • NER 模型,因为缺少 LDC 语料库,目前不可用. 正在解决中正在训练中。
  • 将训练中所用的中间结果 release 出来, 方便用户自行定制模型

使用的组件

  • TODO

如何贡献

请阅读 CONTRIBUTING.md , 然后提交 pull requests 给我们.

版本化控制

我们使用 SemVer 做版本化的标准. 查看 tags 以了解所有的版本.

作者

更多贡献者信息,请参考 contributors.

版权

MIT License - 详见 LICENSE.md

致谢

  • TODO

More Repositories

1

unlocking-the-power-of-llms

使用 Prompts 和 Chains 让 ChatGPT 成为神奇的生产力工具!Unlocking the power of LLMs.
Shell
2,319
star
2

hanzi_char_featurizer

汉字字符特征提取器 (featurizer),提取汉字的特征(发音特征、字形特征)用做深度学习的特征 | A Chinese character feature extractor, which extracts the features of Chinese characters (pronunciation features, glyph features) as features for deep learning
Python
271
star
3

hanzi_chaizi

汉字拆字库,可以将汉字拆解成偏旁部首,在机器学习中作为汉字的字形特征
Python
263
star
4

tools_for_corpus_of_people_daily

人民日报语料处理工具集 | Tools for Corpus of People's Daily
Python
256
star
5

WeatherBot

一个基于 Rasa 的中文天气情况问询机器人(chatbot), 带 Web UI 界面
235
star
6

MicroTokenizer

一个微型&算法全面的中文分词引擎 | A micro tokenizer for Chinese
Python
139
star
7

ATIS_dataset

The ATIS (Airline Travel Information System) Dataset
Python
131
star
8

rasa_chinese

rasa_chinese 专门针对中文语言的 rasa 组件扩展包,提供了许多针对中文语言的组件
Python
119
star
9

seq2annotation

基于 TensorFlow & PaddlePaddle 的通用序列标注算法库(目前包含 BiLSTM+CRF, Stacked-BiLSTM+CRF 和 IDCNN+CRF,更多算法正在持续添加中)实现中文分词(Tokenizer / segmentation)、词性标注(Part Of Speech, POS)和命名实体识别(Named Entity Recognition, NER)等序列标注任务。
Python
82
star
10

MITIE_Chinese_Wikipedia_corpus

Pre-trained Wikipedia corpus by MITIE
52
star
11

chinese-wikipedia-corpus-creator

Corpus creator for Chinese Wikipedia
Python
42
star
12

MicroRegEx

一个微型的正则表达式引擎 | A micro regular expression engine
Jupyter Notebook
37
star
13

Chinese_tokenizer_benchmark

中文分词软件基准测试 | Chinese tokenizer benchmark
Python
21
star
14

rasa_contrib

rasa_contrib is a addon package for rasa. It provide some useful/powerful addition components
Python
21
star
15

NLU_benchmark_dataset

自然语言理解 基准测试 数据集 | Benchmark datasets for Natural Language Understanding (NLU)
Python
21
star
16

corpus_dataset_for_Chinese_NLP

中文 NLP 语料库数据集
18
star
17

four_corner_method

中文「四角号码」数据与工具,可以将汉字拆解成和字形相关的编码,在机器学习中作为汉字的字形特征
HTML
18
star
18

scel2txt

搜狗细胞词库到普通文本的转换提取工具。提取词汇表,用于深度学习做数据生成和字典特征
Python
17
star
19

vimapt

A package manager for vim (VimApt => Vim's Advanced Package Tools)
Python
16
star
20

tf_crf_layer

CRF(Conditional Random Field) Layer for TensorFlow 1.X with many powerful functions
Python
16
star
21

rasa_chinese_service

rasa_chinese 的服务 package
Python
16
star
22

MicroCompiler

一个微型的 LL/LR/LALR 语法解析器 | A micro compiler project to provide LL/LR/LALR syntax parser
Python
15
star
23

WeatherBot_Action

Action server for WeatherBot
Python
14
star
24

WeatherBot_UI

WebChat UI (HTML pages) for WeatherBot
HTML
14
star
25

PaddleTokenizer

使用 PaddlePaddle 实现基于深度神经网络的中文分词引擎 | A DNN Chinese Tokenizer by Using PaddlePaddle
JavaScript
14
star
26

MicroHMM

一个微型的基于 Python 的 HMM (隐马尔可夫模型) 包 | A micro python package for HMM (Hidden Markov Model)
Python
13
star
27

MicroWeatherBot_CN

基于 rasa 1.x 版本搭建的中文天气查询 demo | A simple & micro Chinese Weatherbot based on rasa framework
Python
12
star
28

WeatherBot_Core

Python
10
star
29

entity2embedding

A python package for word2vec
Python
7
star
30

MicroWeatherBot_EN

基于 rasa 1.x 版本搭建的英文天气查询 demo | A simple & micro English Weatherbot based on rasa framework
Python
7
star
31

q_learning_demo

Show how Q-learning works from scratch
Jupyter Notebook
5
star
32

PaddleNER

JavaScript
3
star
33

basic_weather_bot_server

Python
3
star
34

MicroCPUID

A micro tool based on assembly language to detect and display CPU information
Assembly
3
star
35

SDMdata

JavaScript
3
star
36

ner_offline_evaluate

Python
2
star
37

howl-anderson.github.io

HTML
2
star
38

howl-anderson

2
star
39

hanzi_char_lookup_feature

基于字典的方法给字符提供额外的特征,常用于基于深度学习的NER
Python
2
star
40

AIMLChatRobot

Python
1
star
41

how_Chinese_tokenizer_works

Python
1
star
42

google-io-keras-vae

Code for Google IO 2021 Modern Keras design patterns session
Jupyter Notebook
1
star
43

MicroTagger

一个微型的用于提取 Part-Of-Speech (POS) 的 Python 包 | A micro python library for NLP Tagger of Part-Of-Speech (POS)
Python
1
star
44

Assignment_for_Natural_Language_Processing_with_Deep_Learning_CS224n_By_Stanford_University

Assignment for CS224n: Natural Language Processing with Deep Learning By Stanford University
Python
1
star
45

sdmvspecies

SDMvspecies is R package to create virtual species (virtual data or artificial data) for SDM (Species Distribution Modelling)
R
1
star