text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

toxic_comment_processed_seqlen = pd.read_csv('/kaggle/input/jigsaw-multilingual-toxic-comment-classification/jigsaw-toxic-comment-train-processed-seqlen128.csv')
toxic_comment = pd.read_csv('/kaggle/input/jigsaw-multilingual-toxic-comment-classification/jigsaw-toxic-comment-train.csv')
unintended_bias_preprocessed = pd.read_csv('/kaggle/input/jigsaw-multilingual-toxic-comment-classification/jigsaw-unintended-bias-train-processed-seqlen128.csv')
unintended_bias = pd.read_csv('/kaggle/input/jigsaw-multilingual-toxic-comment-classification/jigsaw-unintended-bias-train.csv')

toxic_percentage = toxic_comment['toxic'].value_counts(normalize=True) * 100
unintended_bias_toxic_percentage = (unintended_bias['toxic'] > 0.5).value_counts(normalize=True) * 100

plt.xticks([0, 1], ['Non-toxic', 'Toxic'], rotation=0)
plt.xticks([0, 1], ['Non-toxic', 'Toxic'], rotation=0)
plt.tight_layout()

plt.figure(figsize=(12, 6))
sns.histplot(data=toxic_comment[toxic_comment['word_length'] > 900], x='word_length', hue='is_toxic', bins=50, kde=True)
plt.title('Distribution of Word Length for Toxic and Non-Toxic Comments (from 900 words)')
plt.show()