-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsynsets_plot.py
53 lines (41 loc) · 1.57 KB
/
synsets_plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
"""
## First: sysnet general
models = ['mBERT', 'LatinBERT', 'PhilBERTa', 'PhilTa']
# values = [610.99, 758.39, 699.79, 860.6]
values = [738.18, 960.78, 866.45, 1073.23]
barWidth = 0.18
plt.figure(figsize=(8, 7)) # Adjust figure size if needed
plt.bar(models, values)
for i, value in enumerate(values):
plt.text(i, value + 10, f'{value:.2f}', ha='center', va='bottom', fontsize=14)
plt.xlabel('PLM', fontweight='bold', fontsize=19)
plt.ylabel('Synset candidates', fontweight='bold', fontsize=18)
plt.xticks(fontsize=14)
plt.yticks(fontsize=14)
plt.show()
"""
## Second: synset examples
permota = [328, 592, 1168, 1240]
peperit = [68, 28, 15, 324]
barWidth = 0.18
plt.figure(figsize=(8, 7))
br1 = np.arange(len(permota))
br2 = [x + barWidth for x in br1]
plt.bar(br1, permota, color='sandybrown', width=barWidth,
edgecolor='sandybrown', label='permota')
plt.bar(br2, peperit, color='steelblue', width=barWidth,
edgecolor='steelblue', label='peperit')
for i, value in enumerate(permota):
plt.text(i, value + 10, f'{value:.0f}', ha='center', va='bottom', fontsize=11)
for i, value in enumerate(peperit):
plt.text(i + barWidth, value + 10, f'{value:.0f}', ha='center', va='bottom', fontsize=11)
plt.xlabel('PLM', fontweight='bold', fontsize=15)
plt.ylabel('Synset candidates', fontweight='bold', fontsize=15)
plt.xticks([r + barWidth for r in range(len(permota))],
['mBERT', 'LatinBERT', 'PhilBERTa', 'PhilTa'], fontsize=14)
plt.yticks(fontsize=14)
plt.legend(fontsize=13)
plt.show()