依据标签数量进行分布展示

import seaborn as sns
import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['font.serif'] = ['SimHei']

fig, ax = plt.subplots()
fig.set_size_inches(20, 8)

sns.set_style("darkgrid", {"font.sans-serif": ['simhei', 'Arial']})

df = pd.read_excel("../data/intent_corpus0222_parsed.xlsx")

labels_count = df['label'].value_counts()
sns.barplot(y=labels_count.values, x=labels_count.index)

plt.xticks(rotation=45)  # 旋转90度
plt.show()

你可能感兴趣的:(python,python,机器学习,开发语言)