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

Kum*_*mar 4 nlp machine-learning corpus nltk lexical

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

什么是电影数据集

什么是Wordnet

alv*_*vas 13

语料库语料库复数形式.

语料库基本上是指一个主体,在自然语言处理(NLP)的语境中,它意味着一个文本主体.

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


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']
Run Code Online (Sandbox Code Playgroud)

NLTK中的电影评论数据集(典型地称为Movie Reviews Corpus)是具有情感极性分类的2k电影评论文本数据集(来源:http://www.nltk.org/book/ch02.html)

它通常用于教程目的,以介绍NLP和情绪分析,请参阅http://www.nltk.org/book/ch06.htmlnltk NaiveBayesClassifier培训以进行情绪分析


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

在NLTK中,它包含Open Multilingual WordNet(http://compling.hss.ntu.edu.sg/omw/),允许您查询其他语言的单词.

因为它也是一个单词列表(在这种情况下包括许多其他东西,关系,引理,POS等),它也在nltk.corpusNLTK中使用.

在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')]
Run Code Online (Sandbox Code Playgroud)

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