text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

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.figure(figsize=(16, 5))
plt.subplot(1, 2, 1)
toxic_percentage.plot(kind='bar', color=['blue', 'orange'])
plt.title('Toxic Comment Distribution (jigsaw-toxic-comment-train.csv)')
plt.xlabel('Toxic')
plt.ylabel('Percentage')
plt.xticks([0, 1], ['Non-toxic', 'Toxic'], rotation=0)
plt.subplot(1, 2, 2)
unintended_bias_toxic_percentage.plot(kind='bar', color=['blue', 'orange'])
plt.title('Toxic Comment Distribution (jigsaw-unintended-bias-train.csv)')
plt.xlabel('Toxic')
plt.ylabel('Percentage')
plt.xticks([0, 1], ['Non-toxic', 'Toxic'], rotation=0)
plt.tight_layout()
plt.show()