NikosKprl commited on
Commit
5c5e0c3
·
verified ·
1 Parent(s): c3e6eb6

Update ✨Entity Linking Application✨.py

Browse files
✨Entity Linking Application✨.py CHANGED
@@ -48,7 +48,7 @@ async def combination_method(name, session):
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=10&srprop=&srenablerewrites=True&srinfo=suggestion&format=json"
51
- json_suggestion = await fetch_json(suggested_url, session)
52
  results = json_suggestion.get('query', {}).get('search')
53
  for i in results:
54
  data.add(i.get('title'))
@@ -60,7 +60,7 @@ async def single_method(name, session):
60
  new_name = name.replace("-", " ").replace("/", " ").split()
61
  for i in new_name:
62
  url = f"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch={i}&srlimit=10&srprop=&srenablerewrites=True&srinfo=suggestion&format=json"
63
- json_suggestion = await fetch_json(suggested_url, session)
64
  results = json_suggestion.get('query', {}).get('search')
65
  for i in results:
66
  data.add(i.get('title'))
@@ -73,7 +73,7 @@ async def mains(name, single, combi):
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=15&srprop=&srenablerewrites=True&srinfo=suggestion&format=json"
76
- json_suggestion = await fetch_json(suggested_url, session)
77
  results = json_suggestion.get('query', {}).get('search')
78
  for i in results:
79
  data.add(i.get('title'))
@@ -506,6 +506,9 @@ def main_cli():
506
  ETA = time.strftime("%H:%M:%S", time.gmtime(execution_time))
507
  st.write(f"⌛ Execution time: {ETA}")
508
 
 
 
 
509
  # i think this part can be removed now
510
  folder_path = "qids_folder"
511
  for filename in os.listdir(folder_path):
 
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=10&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:
54
  data.add(i.get('title'))
 
60
  new_name = name.replace("-", " ").replace("/", " ").split()
61
  for i in new_name:
62
  url = f"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch={i}&srlimit=10&srprop=&srenablerewrites=True&srinfo=suggestion&format=json"
63
+ json_suggestion = await fetch_json(url, session)
64
  results = json_suggestion.get('query', {}).get('search')
65
  for i in results:
66
  data.add(i.get('title'))
 
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=15&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:
79
  data.add(i.get('title'))
 
506
  ETA = time.strftime("%H:%M:%S", time.gmtime(execution_time))
507
  st.write(f"⌛ Execution time: {ETA}")
508
 
509
+ if 'run_button' in st.session_state and st.session_state.run_button == False:
510
+ st.session_state.running = False
511
+
512
  # i think this part can be removed now
513
  folder_path = "qids_folder"
514
  for filename in os.listdir(folder_path):