Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
asahi417 commited on
Commit
19c5f43
·
1 Parent(s): 79543d6
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

  • SHA256: b78acc9e0b834b3a28e86743ecff9220a2d77c6793376fc070e5dd2e105adc60
  • Pointer size: 130 Bytes
  • Size of remote file: 54.8 kB
data/stats.predicate_distribution.max_predicate_25.png ADDED

Git LFS Details

  • SHA256: 22a0bb261884e089272088eb33da3665a1163736b5f5e73902a87b4b1138186d
  • Pointer size: 130 Bytes
  • Size of remote file: 48.8 kB
data/stats.predicate_distribution.max_predicate_50.png ADDED

Git LFS Details

  • SHA256: 86ad907696751a4e96ea4a3e03b4b1893dff7453400f4af2f40a9f44d2b25edf
  • Pointer size: 130 Bytes
  • Size of remote file: 52.5 kB
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
- fig = plt.figure()
116
- _df_p = df_p[[f"min entity: {mef}, max predicate: 10" for mef in [1, 2, 3, 4]]]
117
- _df_p.columns = [f"min entity: {mef}" for mef in [1, 2, 3, 4]]
118
- ax = sns.lineplot(data=_df_p, linewidth=2.5)
119
- ax.set(xlabel='unique predicates sorted by frequency', ylabel='number of triples', title='Predicate Distribution (max predicate: 10)')
120
- ax.get_figure().savefig("data/stats.predicate_distribution.png", bbox_inches='tight')
121
- ax.get_figure().clf()
 
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