【发布时间】:2016-06-19 01:04:14
【问题描述】:
我正在尝试使用以下链接中给出的解决方案代码:Unicode Tagging in Python NLTK
在omerbp给出的解决方案中:
from nltk.corpus import indian
from nltk.tag import tnt
train_data = indian.tagged_sents('hindi.pos')
tnt_pos_tagger = tnt.TnT()
tnt_pos_tagger.train(train_data) #Training the tnt Part of speech tagger with hindi data
print tnt_pos_tagger.tag(nltk.word_tokenize(word_to_be_tagged))
我收到以下错误:
'SyntaxError: Non-ASCII character '\xe0' in file q12.py on line 1,但未声明编码;详情见http://www.python.org/peps/pep-0263.html第1行。
【问题讨论】:
-
此错误消息seems to come up a lot here - 这些链接中的任何一个有用吗?