|
|
|
|
|
|
|
import matplotlib.pyplot as plt |
|
import numpy as np |
|
|
|
np.random.seed(0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
models = [ |
|
"Majority", |
|
"Flan-T5", |
|
"GPT-3.5", |
|
"GPT-4", |
|
"Wizard13b", |
|
"Vicuna13b", |
|
"Vicuna33b", |
|
"Mistral17b", |
|
] |
|
accuracy = [0.302, 0.601, 0.468, 0.653, 0.384, 0.379, 0.347, 0.364] |
|
colors = [ |
|
"#3f5e8a", |
|
"#41778c", |
|
"#478f8c", |
|
"#51a686", |
|
"#69bd78", |
|
"#8fcf63", |
|
"#c4de50", |
|
"#fae856", |
|
] |
|
xlabel = "Models" |
|
xticks = np.arange(len(models)) |
|
ylabel = "Accuracy" |
|
ylim = [0, 1.0] |
|
|
|
|
|
|
|
|
|
|
|
fig, ax = plt.subplots(figsize=(8, 4)) |
|
bars = ax.bar(models, accuracy, color=colors) |
|
|
|
|
|
for bar in bars: |
|
yval = bar.get_height() |
|
plt.text( |
|
bar.get_x() + bar.get_width() / 2, |
|
yval, |
|
round(yval, 3), |
|
ha="center", |
|
va="bottom", |
|
) |
|
|
|
|
|
ax.set_ylabel(xlabel) |
|
ax.set_xticks(xticks) |
|
ax.set_xticklabels(models, rotation=45, ha="center") |
|
ax.set_xlabel(ylabel) |
|
|
|
ax.set_ylim(ylim) |
|
|
|
|
|
|
|
|
|
|
|
plt.tight_layout() |
|
plt.savefig("bar_24.pdf", bbox_inches="tight") |
|
|