[英]if form in exceptions: TypeError: unhashable type: 'list' in Python nltk
I got following error. 我收到以下错误。
if form in exceptions: TypeError: unhashable type: 'list'
Following is my code. 以下是我的代码。
from nltk.tokenize import word_tokenize
from nltk.stem.wordnet import WordNetLemmatizer
sentence = 'missed you'
w_tokenize = (word_tokenize(sentence))
for word in w_tokenize:
print WordNetLemmatizer().lemmatize(w_tokenize,'v')
Can anyone tell me how can I fix this error. 谁能告诉我如何解决此错误。
Seems like you have the variables mixed up, it should be 好像您混合了变量,应该
for word in w_tokenize:
print WordNetLemmatizer().lemmatize(word,'v')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.