cyberandy commited on
Commit
320ee5a
·
1 Parent(s): dedd775

adding helper functions

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -15,9 +15,14 @@ def load_model(model_name):
15
  refined_model = Refined.from_pretrained(model_name=model_name, entity_set="wikipedia")
16
  return refined_model
17
 
18
- # Use the cache model
19
  refined_model = load_model(selected_model_name)
20
 
 
 
 
 
 
21
  # Create the form
22
  with st.form(key='my_form'):
23
  text_input = st.text_input(label='Enter a sentence')
 
15
  refined_model = Refined.from_pretrained(model_name=model_name, entity_set="wikipedia")
16
  return refined_model
17
 
18
+ # Use the cached model
19
  refined_model = load_model(selected_model_name)
20
 
21
+ # Helper functions
22
+ def get_wikidata_id(entity_string):
23
+ entity_list = entity_string.split("=")
24
+ return "https://www.wikidata.org/wiki/" + str(entity_list[1])
25
+
26
  # Create the form
27
  with st.form(key='my_form'):
28
  text_input = st.text_input(label='Enter a sentence')