【发布时间】:2013-02-10 01:32:07
【问题描述】:
我正在使用 nltk,所以我想创建自己的自定义文本,就像 nltk.books 上的默认文本一样。但是,我刚刚开始使用类似的方法
my_text = ['This', 'is', 'my', 'text']
我想找到任何方法来输入我的“文本”:
my_text = "This is my text, this is a nice way to input text."
哪种方法,python 或 nltk 允许我这样做。更重要的是,如何消除标点符号?
【问题讨论】:
-
您能否澄清一下,
underestimate punctation symbols是什么意思? -
我认为他的意思是对输入的句子进行标记
-
是的,例如如果我这样做了:sentente = "This is my sentence, a sentence is a short expression" 所以,'sentence' 和 'sentence' 将是两个不同的元素...