Use the NLTK
package and the solution templates to complete these tasks!
Natural Language Processing
- Play around with
NLTK
. It's a fantastic package with a lot of functionality.
- Write a function to extract bigrams from text, returning only those that don't incude words occuring in a set of stopwords passed to the function.
- Write a function that, given a corpus of text and a number of stopwords, returns the n most common bigrams not containing the given stopwords and their counts.
- Write a function that, given a corpus of text, make a pandas data frame that contains binary columns indicating presence of a set of bigrams in each of the corpus' texts.
- Write a function that, given a corpus of positive and negatve texts, makes a classifier that will predict positive or negative sentiment in a text. Return the classifier and the relevant bigrams.