text_plain_output_2.png text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import re

import seaborn as sns

df = pd.read_csv('../input/idcyberbullying/id-cyberbullying-instagram.tsv', sep='\t', encoding='ISO-8859-1')
df

df.label.value_counts()

analysis_df = df[['text', 'label']]

comment_len = pd.Series([len(comment.split()) for comment in df['text']])

df['Length'] = df.text.str.split().apply(len)

df['Length'] = df.text.str.split().apply(len)

comments = analysis_df.text
def removeURL(comments):
    url_pattern = re.compile('https?://\\S+|www\\.\\S+')
    comments = url_pattern.sub('', comments)
    return comments
comments = comments.apply(lambda x: removeURL(x))

analysis_df.columns

analysis_df['label'].value_counts()