text_html_output_1.png
import matplotlib.pyplot as plt # ploting library

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

import seaborn as sns

df = pd.read_csv('../input/machathon-20-final-round/train_ara.csv')

classes = df.intent.unique()
classes

df['intent_id'] = df['intent'].factorize()[0]
intent_id_df = df[['intent', 'intent_id']].drop_duplicates()
intent_to_id = dict(intent_id_df.values)
id_to_intent = dict(intent_id_df[['intent_id', 'intent']].values)

plt.figure(figsize=(15, 10))
counts = df['intent'].value_counts()
base_color = sns.color_palette()[0]
sns.countplot(data=df, y='intent', order=counts.index, orient='v', color=base_color, linewidth=100)
plt.ylabel('Count', fontsize=14)
plt.xlabel('intents', fontsize=14)
plt.title('Most Frequent intents', fontsize=20)
plt.xticks(size=12)
totale = len(df)
locs, labels = plt.yticks(size=14)
for loc, label in zip(locs, labels):
    count = counts[label.get_text()]
    pct_string = '{:0.1f}%'.format(100 * count / totale)
    plt.text(count + 8, loc + 0.3, pct_string, ha='center', color='black', fontsize=12)