Spaces:
Runtime error
Runtime error
Update ✨Entity Linking Application✨.py
Browse files
✨Entity Linking Application✨.py
CHANGED
|
@@ -436,8 +436,8 @@ def main_cli():
|
|
| 436 |
json_file = json.load(f)
|
| 437 |
lista = []
|
| 438 |
lista_1 = []
|
| 439 |
-
my_bar = st.progress(0
|
| 440 |
-
for element in json_file:
|
| 441 |
qid = element.get("qid")
|
| 442 |
link = f"https://www.wikidata.org/wiki/{qid}"
|
| 443 |
label = element.get("label")
|
|
@@ -447,7 +447,7 @@ def main_cli():
|
|
| 447 |
desc_emb = model.encode([description])
|
| 448 |
|
| 449 |
lista.append({link: [label_emb, desc_emb]})
|
| 450 |
-
my_bar.progress(
|
| 451 |
print(qid)
|
| 452 |
|
| 453 |
label_dataset_emb = model.encode([i])
|
|
|
|
| 436 |
json_file = json.load(f)
|
| 437 |
lista = []
|
| 438 |
lista_1 = []
|
| 439 |
+
my_bar = st.progress(0)
|
| 440 |
+
for i, element in enumerate(json_file):
|
| 441 |
qid = element.get("qid")
|
| 442 |
link = f"https://www.wikidata.org/wiki/{qid}"
|
| 443 |
label = element.get("label")
|
|
|
|
| 447 |
desc_emb = model.encode([description])
|
| 448 |
|
| 449 |
lista.append({link: [label_emb, desc_emb]})
|
| 450 |
+
my_bar.progress((i + 1) / len(json_file))
|
| 451 |
print(qid)
|
| 452 |
|
| 453 |
label_dataset_emb = model.encode([i])
|