【发布时间】:2013-07-18 21:47:38
【问题描述】:
我正在处理这个wonderful tutorial。
我下载了一个名为book的合集:
>>> import nltk
>>> nltk.download()
和导入的文本:
>>> from nltk.book import *
*** Introductory Examples for the NLTK Book ***
Loading text1, ..., text9 and sent1, ..., sent9
Type the name of the text or sentence to view it.
Type: 'texts()' or 'sents()' to list the materials.
text1: Moby Dick by Herman Melville 1851
text2: Sense and Sensibility by Jane Austen 1811
然后我可以对这些文本运行命令:
>>> text1.concordance("monstrous")
如何在我自己的数据集上运行这些 nltk 命令?这些集合和python中的对象book一样吗?
【问题讨论】:
-
请注意,当您只需要
nltk.book函数时,可能不需要import nltk。