Skip to content

Instantly share code, notes, and snippets.

@quantra-go-algo
Created June 20, 2023 17:19
Show Gist options
  • Save quantra-go-algo/4b64ed88b7c972fd13c4a83e53f3b960 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/4b64ed88b7c972fd13c4a83e53f3b960 to your computer and use it in GitHub Desktop.
# Import libraries
import nltk
from nltk.corpus import twitter_samples
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem import PorterStemmer
from nltk.classify import NaiveBayesClassifier
from nltk.sentiment import SentimentAnalyzer
from nltk.sentiment.util import extract_unigram_feats
# Download NLTK resources
nltk.download('twitter_samples')
nltk.download('stopwords')
nltk.download('punkt')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment