python nlp 句子提取_自然语言16.1_Python自然语言处理学习笔记之信息提取步骤&分块(chunking)...

1ccb5189f9677602c26e25142f0d9aef.png

QQ:231469242

欢迎喜欢nltk朋友交流

http://www.cnblogs.com/undercurrent/p/4754944.html

一、信息提取模型

信息提取的步骤共分为五步,原始数据为未经处理的字符串,

第一步:分句,用nltk.sent_tokenize(text)实现,得到一个list of strings

第二步:分词,[nltk.word_tokenize(sent) for sent in sentences]实现,得到list of lists of strings

第三步:标记词性,[nltk.pos_tag(sent) for sent in sentences]实现得到一个list of lists of tuples

前三步可以定义在一个函数中:

>>> defie_preprocess(document):

... sentences =nltk.sent_tokenize(document)

... sentences = [nltk.word_tokenize(sent) for sent insentences]

... sentences = [nltk.pos_tag(sent) for sent in sentences]

第四步:实体识别(entity detection)在这一步,既要识别已定

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值