machine-learning - NLTK(python)中的语料库和词典有什么区别

标签 machine-learning nlp nltk corpus lexical

有人可以告诉我 NLTK 中语料库语料库词典之间的区别吗?

什么是电影数据集

什么是Wordnet

最佳答案

Corpora 是语料库的复数

语料库基本上意味着主体,在自然语言处理(NLP)的上下文中,它意味着文本主体。

(来源:https://www.google.com.sg/search?q=corpora)

<小时/>

Lexicon 是词汇表、单词列表、字典(来源: https://www.google.com.sg/search?q=lexicon )

在 NLTK 中,任何词典都被视为语料库,因为单词列表也是文本主体。例如。停用词列表可以在 NLTK 语料库 API 中找到:

>>> from nltk.corpus import stopwords
>>> print stopwords.words('english')
[u'i', u'me', u'my', u'myself', u'we', u'our', u'ours', u'ourselves', u'you', u'your', u'yours', u'yourself', u'yourselves', u'he', u'him', u'his', u'himself', u'she', u'her', u'hers', u'herself', u'it', u'its', u'itself', u'they', u'them', u'their', u'theirs', u'themselves', u'what', u'which', u'who', u'whom', u'this', u'that', u'these', u'those', u'am', u'is', u'are', u'was', u'were', u'be', u'been', u'being', u'have', u'has', u'had', u'having', u'do', u'does', u'did', u'doing', u'a', u'an', u'the', u'and', u'but', u'if', u'or', u'because', u'as', u'until', u'while', u'of', u'at', u'by', u'for', u'with', u'about', u'against', u'between', u'into', u'through', u'during', u'before', u'after', u'above', u'below', u'to', u'from', u'up', u'down', u'in', u'out', u'on', u'off', u'over', u'under', u'again', u'further', u'then', u'once', u'here', u'there', u'when', u'where', u'why', u'how', u'all', u'any', u'both', u'each', u'few', u'more', u'most', u'other', u'some', u'such', u'no', u'nor', u'not', u'only', u'own', u'same', u'so', u'than', u'too', u'very', u's', u't', u'can', u'will', u'just', u'don', u'should', u'now']
<小时/>

NLTK 中的电影评论数据集(通常称为电影评论语料库)是具有情感极性分类的 2k 电影评论文本数据集 (来源:http://www.nltk.org/book/ch02.html)

它通常用于教程目的,介绍 NLP 和情感分析,请参阅 http://www.nltk.org/book/ch06.htmlnltk NaiveBayesClassifier training for sentiment analysis

<小时/>

WordNet英语词汇数据库(它就像具有字与字关系的词典/词典)(来源: https://wordnet.princeton.edu/ )。

在 NLTK 中,它集成了开放多语言 WordNet ( http://compling.hss.ntu.edu.sg/omw/ ),允许您查询其他语言的单词。

由于它也是一个单词列表(在本例中还包括许多其他内容,如关系、引理、词性等),因此也可以使用 NLTK 中的 nltk.corpus 来调用它。

在 NLTK 中使用 wordnet 的规范习惯用法如下:

>>> from nltk.corpus import wordnet as wn
>>> wn.synsets('dog')
[Synset('dog.n.01'), Synset('frump.n.01'), Synset('dog.n.03'), Synset('cad.n.01'), Synset('frank.n.02'), Synset('pawl.n.01'), Synset('andiron.n.01'), Synset('chase.v.01')]
<小时/>

理解/学习 NLP 术语和基础知识的最简单方法是阅读 NLTK 书中的这些教程:http://www.nltk.org/book/

关于machine-learning - NLTK(python)中的语料库和词典有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31526644/

相关文章:

optimization - 生成匹配对进行统计分析

python - 用于情感分析的 nltk NaiveBayesClassifier 训练

python - 如何快速从列表中获取唯一的单词?

r - R 中的基本词干提取代替根词干提取

python - 如何在 Twitter 数据的 Pandas 数据框上应用 NLTK word_tokenize 库?

python - 在 Python 中的标记化文本中查找多词术语

java - 元语言,如 BNF 或 XML-Schema,用于根据树模型验证树实例

python-3.x - 反向传播神经网络

machine-learning - 信息检索 (IR)、数据挖掘、机器学习 (ML)

python - 更快地计算字符串中的短语数