您的位置:首页 > 其它

【NLP学习笔记】文本处理的常见操作

2018-12-26 19:46 309 查看

sentence segmentation(断句)

一般根据标点符号即可进行断句

tokenization(分词)

人类可以很快知道“我喜欢你”里面“我”是一个词,“喜欢”是一个词,“你”是另外一个词,但是机器不知道,所以要做分词。相比较于中文,英文更容易辨识词的属性,因为英语的句子由一个个单词组成,单词之间以空格隔开,因此用空格作为分词符。

parts-of-speech tagging(词性标注)

词性标注用来区别一个单词的词性,如动词、名词、形容词等。这个标注工作可以根据一个词性分类模型得出。

lemmatization(词性还原)

英语中不同词性的单词变行有很多,比如单复数、be动词原形、动词时态等,都还原成最初的样子。

identifying stop-words(识别停用词)

如“and”,“the”,“of”等这种高频词汇造成统计噪音的词,被称为stop Words,一般会被直接过滤掉。维基百科中说明,现在虽然停用词列表很多,但一定要根据实际情况进行配置。比如英语的the,通常情况下是停用词,但很多乐队名字有这个词,这个时候就不能作为停用词了。

dependency parsing(解析依赖关系)

解析句子中每个词之间的依赖关系,最终建立关系依赖书。树的root是关键动词,从关键动词开始,把整个句子中的词都联系起来。

named entity recognition(命名实体识别)

给名词打标签。比如某句话中有BeiJing,可以把它地理名称识别出来。

conference resolution(共指消解)

指代词,比如他、它、她、这个、那个等。再比如缩写简称,如北京大学通常称为北大。这种现象,被称为共指现象。

举例

London is the capital of the UK, with seven million people. London is in the south of England and it’s on the River Thames. The river is 336kilometres long. London is an old city-about 2,000years old.

1.sentence segmentation
可以分为四个句子

  1. London is the capital of the UK, with seven million people.
  2. London is in the south of England and it’s on the River Thames.
  3. The river is 336kilometres long.
  4. London is an old city-about 2,000years old.

2.tokenization.
如第一个句子:
London is the capital of the UK, with seven million people.
分词结果如下(包含标点符号)
“London”“is”“the”“capital”“of”“the”“UK”“,”“ with”“seven”“million” “people”“. ”

3.parts-of-speech tagging

4.lemmatization

5.identifying stop-words

灰色框中为停用词

6.dependency parsing

7.named entity recognition

8.conference resolution

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: