naveed-stockmark commited on
Commit
6ed4b2f
·
verified ·
1 Parent(s): a96179f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -28,6 +28,8 @@ inverse_dict = {
28
  'material_of': 'made_from_material'
29
  }
30
 
 
 
31
  st.title("Materials use case search app")
32
 
33
  # User Input
@@ -337,7 +339,7 @@ if len(match_df) > 0:
337
  st.write("Other inferences involving the same edge")
338
  neg_instances[['source_en', 'relation', 'target_en', 'text', 'source_wikidata', 'target_wikidata', 'source', 'page_title', 'score', 'section']]
339
 
340
- count_dict = dict(Counter(instances.relation.to_list() + neg_instances.relation.to_list()))
341
  count_df = pd.DataFrame.from_dict(count_dict, orient='index')
342
  count_df.columns = ['count']
343
  st.write("Inference distribution for above edge")
 
28
  'material_of': 'made_from_material'
29
  }
30
 
31
+ all_relations = ['uses', 'has_part', 'has_use', 'part_of', 'made_from_material', 'material_of']
32
+
33
  st.title("Materials use case search app")
34
 
35
  # User Input
 
339
  st.write("Other inferences involving the same edge")
340
  neg_instances[['source_en', 'relation', 'target_en', 'text', 'source_wikidata', 'target_wikidata', 'source', 'page_title', 'score', 'section']]
341
 
342
+ count_dict = {relation: rel_data[f'{relation}_support'] for relation in all_relations}
343
  count_df = pd.DataFrame.from_dict(count_dict, orient='index')
344
  count_df.columns = ['count']
345
  st.write("Inference distribution for above edge")