init
Browse files- README.md +1 -1
- data/{stats.predicate_distribution.png → stats.predicate_distribution.max_predicate_10.png} +2 -2
- data/stats.predicate_distribution.max_predicate_100.png +3 -0
- data/stats.predicate_distribution.max_predicate_25.png +3 -0
- data/stats.predicate_distribution.max_predicate_50.png +3 -0
- stats.py +8 -7
README.md
CHANGED
@@ -66,7 +66,7 @@ If the number of triples in a predicate is higher than `max predicate`, we choos
|
|
66 |
|
67 |
- distribution of predicates
|
68 |
|
69 |
-
<img src="https://huggingface.co/datasets/relbert/t_rex/resolve/main/data/stats.predicate_distribution.png" alt="" width="500" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
70 |
|
71 |
|
72 |
## Dataset Structure
|
|
|
66 |
|
67 |
- distribution of predicates
|
68 |
|
69 |
+
<img src="https://huggingface.co/datasets/relbert/t_rex/resolve/main/data/stats.predicate_distribution.max_predicate_100.png" alt="" width="500" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
|
70 |
|
71 |
|
72 |
## Dataset Structure
|
data/{stats.predicate_distribution.png → stats.predicate_distribution.max_predicate_10.png}
RENAMED
File without changes
|
data/stats.predicate_distribution.max_predicate_100.png
ADDED
![]() |
Git LFS Details
|
data/stats.predicate_distribution.max_predicate_25.png
ADDED
![]() |
Git LFS Details
|
data/stats.predicate_distribution.max_predicate_50.png
ADDED
![]() |
Git LFS Details
|
stats.py
CHANGED
@@ -112,13 +112,14 @@ if __name__ == '__main__':
|
|
112 |
# plot predicate distribution
|
113 |
df_p = pd.DataFrame([dict(enumerate(sorted(p.values(), reverse=True))) for p in p_dist_full]).T
|
114 |
df_p.columns = [f"min entity: {mef}, max predicate: {mpf}" for mef, mpf in candidates]
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
|
|
122 |
|
123 |
# plot entity distribution
|
124 |
df_e = pd.DataFrame([dict(enumerate(sorted(e.values(), reverse=True))) for e in e_dist_full]).T
|
|
|
112 |
# plot predicate distribution
|
113 |
df_p = pd.DataFrame([dict(enumerate(sorted(p.values(), reverse=True))) for p in p_dist_full]).T
|
114 |
df_p.columns = [f"min entity: {mef}, max predicate: {mpf}" for mef, mpf in candidates]
|
115 |
+
for mpf in [100, 50, 25, 10]:
|
116 |
+
fig = plt.figure()
|
117 |
+
_df_p = df_p[[f"min entity: {mef}, max predicate: {mpf}" for mef in [1, 2, 3, 4]]]
|
118 |
+
_df_p.columns = [f"min entity: {mef}" for mef in [1, 2, 3, 4]]
|
119 |
+
ax = sns.lineplot(data=_df_p, linewidth=2.5)
|
120 |
+
ax.set(xlabel='unique predicates sorted by frequency', ylabel=f'number of triples', title='Predicate Distribution (max predicate: {mpf})')
|
121 |
+
ax.get_figure().savefig(f"data/stats.predicate_distribution.max_predicate_{mpf}.png", bbox_inches='tight')
|
122 |
+
ax.get_figure().clf()
|
123 |
|
124 |
# plot entity distribution
|
125 |
df_e = pd.DataFrame([dict(enumerate(sorted(e.values(), reverse=True))) for e in e_dist_full]).T
|