Anzeige
You will use nltk to explore the Herman Melville novel Moby Dick- Writ.docx
Nächste SlideShare
You were initially tasked with surveying the Gribell Island population.docxYou were initially tasked with surveying the Gribell Island population.docx
Wird geladen in ... 3
1 von 1
Anzeige

Más contenido relacionado

Más de karlynwih(20)

Anzeige

You will use nltk to explore the Herman Melville novel Moby Dick- Writ.docx

  1. You will use nltk to explore the Herman Melville novel Moby Dick. Write the python code for answering the following questions: Find how many tokens are unique after removing stopwords. you can use follwing sample code from nltk.corpus import stopwords stop_words = set(stopwords.words('english')) def example_three(): filtered_sentence = [w for w in raw if not w.lower() in stop_words] filtered_sentence = [] for w in raw: if w not in stop_words: filtered_sentence.append(w) return len(set(nltk.word_tokenize(filtered_sentence))) example_three()
Anzeige