Update ✨Entity Linking Application✨.py
Browse files
✨Entity Linking Application✨.py
CHANGED
@@ -286,7 +286,7 @@ def main_cli():
|
|
286 |
st.title("✨ Entity Linking Application ✨")
|
287 |
st.caption("This web application is part of my master’s dissertation.")
|
288 |
|
289 |
-
if "
|
290 |
st.session_state.disabled = False
|
291 |
|
292 |
def disable_inputs():
|
@@ -436,6 +436,7 @@ def main_cli():
|
|
436 |
json_file = json.load(f)
|
437 |
lista = []
|
438 |
lista_1 = []
|
|
|
439 |
for element in json_file:
|
440 |
qid = element.get("qid")
|
441 |
link = f"https://www.wikidata.org/wiki/{qid}"
|
@@ -446,6 +447,7 @@ def main_cli():
|
|
446 |
desc_emb = model.encode([description])
|
447 |
|
448 |
lista.append({link: [label_emb, desc_emb]})
|
|
|
449 |
print(qid)
|
450 |
|
451 |
label_dataset_emb = model.encode([i])
|
|
|
286 |
st.title("✨ Entity Linking Application ✨")
|
287 |
st.caption("This web application is part of my master’s dissertation.")
|
288 |
|
289 |
+
if "disabled" not in st.session_state:
|
290 |
st.session_state.disabled = False
|
291 |
|
292 |
def disable_inputs():
|
|
|
436 |
json_file = json.load(f)
|
437 |
lista = []
|
438 |
lista_1 = []
|
439 |
+
my_bar = st.progress(0, text={len(json_file)})
|
440 |
for element in json_file:
|
441 |
qid = element.get("qid")
|
442 |
link = f"https://www.wikidata.org/wiki/{qid}"
|
|
|
447 |
desc_emb = model.encode([description])
|
448 |
|
449 |
lista.append({link: [label_emb, desc_emb]})
|
450 |
+
my_bar.progress(len(element) + 1)
|
451 |
print(qid)
|
452 |
|
453 |
label_dataset_emb = model.encode([i])
|