Downloads · 30 days
0
Napoleon/vaderwithnlkt
vaderwithnlkt is a machine learning model from Napoleon. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Downloads · 30 days
0
Access
Public
Updated May 5, 2022
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.2 KB · 75%
From the Hugging Face model README
import nltk
nltk.download('vader_lexicon') nltk.download('punkt')
from nltk.sentiment.vader import SentimentIntensityAnalyzer
y_pred = [] sid = SentimentIntensityAnalyzer() for row in df_test.iterrows():
sscore = sid.polarity_scores(row[1]['message'])
if sscore['neg'] >= sscore['pos']:
y_pred.append(0)
else:
y_pred.append(1)