'nltk Lemmatizer TypeError: unhashable type: 'list'
import nltk
from nltk.stem import WordNetLemmatizer
lemmatizer = nltk.WordNetLemmatizer()
import self as self
intents = json.loads(open('intents.json').read())
words = []
classes = []
documents = []
ignore_letters = ['?', '!', '.', ',', '~']
lemmatizer = WordNetLemmatizer
words = [lemmatizer.lemmatize(self, word) for word in words if word and word not in ignore_letters]
words = sorted(set(words))
print("words")
When I run my code, TypeError: unhashable type: 'list' will show. I don't know how to solve this error please help. Thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
