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

dataset = pd.read_csv('../input/emotions-in-text/Emotion_final.csv')
dataset.sample(5)

def get_longest_text(texts):
    longest_input = 0
    for text in texts:
        text_len = len(text.split())
        longest_input = max(longest_input, text_len)
    return longest_input
longest_input = get_longest_text(dataset['Text'])
longest_input

def get_total_words(texts):
    total_words = []
    for text in texts:
        for word in text.split():
            if word not in total_words:
                total_words.append(word)
    return len(total_words)
word_count = get_total_words(dataset['Text'])
word_count