楼主: ReneeBK
2258 18

[DeepNLP]Deep Learning NLP Pipeline on Tensorflow [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4897份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49635 个
通用积分
55.6937
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57805 点
帖子
4005
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

楼主
ReneeBK 发表于 2017-9-8 03:51:15 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
  1. Deep Learning NLP Pipeline implemented on Tensorflow. Following the 'simplicity' rule, this project aims to use the deep learning library of Tensorflow to implement new NLP pipeline. You can extend the project to train models with your own corpus/languages. Pretrained models of Chinese corpus are distributed. Free RESTful NLP API are also provided. Visit http://www.deepnlp.org/api/v1.0/pipeline for details.

  2. Brief Introduction

  3. Modules
  4. Installation
  5. Tutorial
  6. Segmentation
  7. POS
  8. NER
  9. Pipeline
  10. Textsum
  11. Textrank
  12. Textcnn
  13. Train your model
  14. Web API Service
  15. 中文简介
  16. 安装说明
  17. Reference
  18. Modules

  19. NLP Pipeline Modules:

  20. Word Segmentation/Tokenization
  21. Part-of-speech (POS)
  22. Named-entity-recognition(NER)
  23. textsum: automatic summarization Seq2Seq-Attention models
  24. textrank: extract the most important sentences
  25. textcnn: document classification
  26. Web API: Free Tensorflow empowered web API
  27. Planed: Parsing, Automatic Summarization
  28. Algorithm(Closely following the state-of-Art)

  29. Word Segmentation: Linear Chain CRF(conditional-random-field), based on python CRF++ module
  30. POS: LSTM/BI-LSTM network, based on Tensorflow
  31. NER: LSTM/BI-LSTM/LSTM-CRF network, based on Tensorflow
  32. Textsum: Seq2Seq with attention mechanism
  33. Texncnn: CNN
  34. Pre-trained Model

  35. Chinese: Segmentation, POS, NER (1998 china daily corpus)
  36. English: POS (brown corpus)
  37. For your Specific Language, you can easily use the script to train model with the corpus of your language choice.
  38. Installation

  39. Requirements

  40. CRF++ (>=0.54)
  41. Tensorflow(1.0) This project is up to date with the latest tensorflow release. For tensorflow (<=0.12.0), use deepnlp <=0.1.5 version. See RELEASE.md for more details
  42. Pip

  43.     # linux, run the script:
  44.     pip install deepnlp
复制代码

本帖隐藏的内容

https://github.com/rockingdingo/deepnlp#segmentation


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:pipeline Learning earning Tensor Learn

沙发
ReneeBK 发表于 2017-9-8 03:52:10
  1. Download pretrained models

  2. 下载预训练模型 If you install deepnlp via pip, the pre-trained models are not distributed due to size restriction. You can download full models for 'Segment', 'POS' en and zh, 'NER' zh, 'Textsum' by calling the download function.

  3. import deepnlp
  4. # Download all the modules
  5. deepnlp.download()

  6. # Download only specific module
  7. deepnlp.download('segment')
  8. deepnlp.download('pos')
  9. deepnlp.download('ner')
  10. deepnlp.download('textsum')
复制代码

藤椅
ReneeBK 发表于 2017-9-8 03:52:40
  1. Segmentation

  2. 分词模块

  3. #coding=utf-8
  4. from __future__ import unicode_literals

  5. from deepnlp import segmenter

  6. text = "我刚刚在浙江卫视看了电视剧老九门,觉得陈伟霆很帅"
  7. segList = segmenter.seg(text)
  8. text_seg = " ".join(segList)

  9. print (text.encode('utf-8'))
  10. print (text_seg.encode('utf-8'))

  11. #Results
  12. #我 刚刚 在 浙江卫视 看 了 电视剧 老九门 , 觉得 陈伟霆 很 帅
复制代码

板凳
ReneeBK 发表于 2017-9-8 03:53:33
  1. POS

  2. 词性标注

  3. #coding:utf-8
  4. from __future__ import unicode_literals

  5. import deepnlp
  6. deepnlp.download('pos')

  7. ## English Model
  8. from deepnlp import pos_tagger
  9. tagger = pos_tagger.load_model(lang = 'en')  # Loading English model, lang code 'en', English Model Brown Corpus

  10. text = "I want to see a funny movie"
  11. words = text.split(" ")     # unicode
  12. print (" ".join(words).encode('utf-8'))

  13. tagging = tagger.predict(words)
  14. for (w,t) in tagging:
  15.     str = w + "/" + t
  16.     print (str.encode('utf-8'))
  17.    
  18. #Results
  19. #I/nn want/vb to/to see/vb a/at funny/jj movie/nn

  20. ## Chinese Model
  21. from deepnlp import segmenter
  22. from deepnlp import pos_tagger
  23. tagger = pos_tagger.load_model(lang = 'zh') # Loading Chinese model, lang code 'zh', China Daily Corpus

  24. text = "我爱吃北京烤鸭"
  25. words = segmenter.seg(text) # words in unicode coding
  26. print (" ".join(words).encode('utf-8'))

  27. tagging = tagger.predict(words)  # input: unicode coding
  28. for (w,t) in tagging:
  29.     str = w + "/" + t
  30.     print (str.encode('utf-8'))

  31. #Results
  32. #我/r 爱/v 吃/v 北京/ns 烤鸭/n
复制代码

报纸
ReneeBK 发表于 2017-9-8 03:54:11
  1. NER

  2. 命名实体识别

  3. #coding:utf-8
  4. from __future__ import unicode_literals

  5. # Download pretrained NER model
  6. import deepnlp
  7. deepnlp.download('ner')

  8. from deepnlp import segmenter
  9. from deepnlp import ner_tagger
  10. tagger = ner_tagger.load_model(lang = 'zh') # Loading Chinese NER model

  11. text = "我爱吃北京烤鸭"
  12. words = segmenter.seg(text)
  13. print (" ".join(words).encode('utf-8'))

  14. tagging = tagger.predict(words)
  15. for (w,t) in tagging:
  16.     str = w + "/" + t
  17.     print (str.encode('utf-8'))

  18. #Results
  19. #我/nt 爱/nt 吃/nt 北京/p 烤鸭/nt
复制代码

地板
ReneeBK 发表于 2017-9-8 03:54:36
  1. Pipeline

  2. #coding:utf-8
  3. from __future__ import unicode_literals

  4. from deepnlp import pipeline
  5. p = pipeline.load_model('zh')

  6. #Segmentation
  7. text = "我爱吃北京烤鸭"
  8. res = p.analyze(text)

  9. print (res[0].encode('utf-8'))
  10. print (res[1].encode('utf-8'))
  11. print (res[2].encode('utf-8'))

  12. words = p.segment(text)
  13. pos_tagging = p.tag_pos(words)
  14. ner_tagging = p.tag_ner(words)

  15. print (pos_tagging.encode('utf-8'))
  16. print (ner_tagging.encode('utf-8'))
复制代码

7
MouJack007 发表于 2017-9-8 03:57:07
谢谢楼主分享!

8
MouJack007 发表于 2017-9-8 03:57:26

9
liuxf666 发表于 2017-9-8 04:29:05
Great, thanks for sharing!

10
franky_sas 发表于 2017-9-8 09:09:46

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 19:33