Spaces:
Runtime error
Runtime error
Update ✨Entity Linking Application✨.py
Browse files
✨Entity Linking Application✨.py
CHANGED
|
@@ -47,7 +47,7 @@ async def combination_method(name, session):
|
|
| 47 |
x = itertools_combinations(new_name, 2)
|
| 48 |
for i in x:
|
| 49 |
new_word = (i[0] + " " + i[1])
|
| 50 |
-
url = f"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch={new_word}&srlimit=
|
| 51 |
json_suggestion = await fetch_json(url, session)
|
| 52 |
results = json_suggestion.get('query', {}).get('search')
|
| 53 |
for i in results:
|
|
@@ -72,7 +72,7 @@ async def mains(name, single, combi):
|
|
| 72 |
qids = set()
|
| 73 |
|
| 74 |
async with aiohttp.ClientSession() as session:
|
| 75 |
-
url = f"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch={name}&srlimit=
|
| 76 |
json_suggestion = await fetch_json(url, session)
|
| 77 |
results = json_suggestion.get('query', {}).get('search')
|
| 78 |
for i in results:
|
|
@@ -507,11 +507,8 @@ def main_cli():
|
|
| 507 |
execution_time = end_time - start_time
|
| 508 |
ETA = time.strftime("%H:%M:%S", time.gmtime(execution_time))
|
| 509 |
st.write(f"⌛ Execution time: {ETA}")
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
st.session_state.running = True
|
| 513 |
-
else:
|
| 514 |
-
st.session_state.running = False
|
| 515 |
|
| 516 |
# i think this part can be removed now
|
| 517 |
folder_path = "qids_folder"
|
|
|
|
| 47 |
x = itertools_combinations(new_name, 2)
|
| 48 |
for i in x:
|
| 49 |
new_word = (i[0] + " " + i[1])
|
| 50 |
+
url = f"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch={new_word}&srlimit=5&srprop=&srenablerewrites=True&srinfo=suggestion&format=json"
|
| 51 |
json_suggestion = await fetch_json(url, session)
|
| 52 |
results = json_suggestion.get('query', {}).get('search')
|
| 53 |
for i in results:
|
|
|
|
| 72 |
qids = set()
|
| 73 |
|
| 74 |
async with aiohttp.ClientSession() as session:
|
| 75 |
+
url = f"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch={name}&srlimit=10&srprop=&srenablerewrites=True&srinfo=suggestion&format=json"
|
| 76 |
json_suggestion = await fetch_json(url, session)
|
| 77 |
results = json_suggestion.get('query', {}).get('search')
|
| 78 |
for i in results:
|
|
|
|
| 507 |
execution_time = end_time - start_time
|
| 508 |
ETA = time.strftime("%H:%M:%S", time.gmtime(execution_time))
|
| 509 |
st.write(f"⌛ Execution time: {ETA}")
|
| 510 |
+
|
| 511 |
+
st.button("Rerun", disabled=False)
|
|
|
|
|
|
|
|
|
|
| 512 |
|
| 513 |
# i think this part can be removed now
|
| 514 |
folder_path = "qids_folder"
|