We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40a5096 commit a48ed32Copy full SHA for a48ed32
lemmatizing.py
@@ -0,0 +1,24 @@
1
+# coding: utf-8
2
+import nltk
3
+from nltk.corpus import stopwords
4
+from nltk.stem import WordNetLemmatizer
5
+
6
+stopword = stopwords.words('english')
7
+wordnet_lemmatizer = WordNetLemmatizer()
8
9
+def lemmatize(text):
10
+ """
11
+ take string input and lemmatize the words.
12
+ use WordNetLemmatizer to lemmatize the words.
13
14
+ word_tokens = nltk.word_tokenize(text)
15
+ lemmatized_word = [wordnet_lemmatizer.lemmatize(word) for word in word_tokens]
16
+ return (lemmatized_word)
17
18
+def main():
19
+ text = "the functions of this fan is awesome"
20
+ print (remove_punct(text))
21
22
+if __name__ == '__main__':
23
+ main()
24
0 commit comments