text_html_output_1.png
import os

import pandas as pd  # data processing, CSV file I/O (e.g. pd.read_csv)

import os
df = pd.read_csv('/kaggle/input/emotion-detection-from-text/tweet_emotions.csv')

df.content.iloc[-10:]

df.sentiment.value_counts()

df = df[df.sentiment != 'anger']
df = df[df.sentiment != 'boredom']
df = df[df.sentiment != 'enthusiasm']
df = df[df.sentiment != 'empty']
df = df[df.sentiment != 'sentiment']

df.sentiment.value_counts()

possible_labels = df.sentiment.unique()

label_dict = {}
for index, possible_label in enumerate(possible_labels):
    label_dict[possible_label] = index

df['label'] = df.sentiment.replace(label_dict)
df.head()