Spaces:
Runtime error
Runtime error
Update ✨Entity Linking Application✨.py
Browse files
✨Entity Linking Application✨.py
CHANGED
|
@@ -62,8 +62,8 @@ async def combination_method(name, session):
|
|
| 62 |
for i in x:
|
| 63 |
new_word = (i[0] + " " + i[1])
|
| 64 |
url = f"{new_word} site:en.wikipedia.org"
|
| 65 |
-
|
| 66 |
-
for i in
|
| 67 |
data.add(i.split("/")[-1])
|
| 68 |
return data
|
| 69 |
|
|
@@ -73,8 +73,8 @@ async def single_method(name, session):
|
|
| 73 |
new_name = name.replace("-", " ").replace("/", " ").split()
|
| 74 |
for i in new_name:
|
| 75 |
url = f"{i} site:en.wikipedia.org"
|
| 76 |
-
|
| 77 |
-
for i in
|
| 78 |
data.add(i.split("/")[-1])
|
| 79 |
return data
|
| 80 |
|
|
@@ -85,8 +85,8 @@ async def mains(name, single, combi):
|
|
| 85 |
|
| 86 |
async with aiohttp.ClientSession() as session:
|
| 87 |
url = f"{name} site:en.wikipedia.org"
|
| 88 |
-
|
| 89 |
-
for i in
|
| 90 |
data.add(i.split("/")[-1])
|
| 91 |
|
| 92 |
wikipedia_url = f"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch={name}&srlimit=1&srprop=&srenablerewrites=True&srinfo=suggestion&format=json"
|
|
|
|
| 62 |
for i in x:
|
| 63 |
new_word = (i[0] + " " + i[1])
|
| 64 |
url = f"{new_word} site:en.wikipedia.org"
|
| 65 |
+
s = search(url, num_results = 12, lang="en")
|
| 66 |
+
for i in s:
|
| 67 |
data.add(i.split("/")[-1])
|
| 68 |
return data
|
| 69 |
|
|
|
|
| 73 |
new_name = name.replace("-", " ").replace("/", " ").split()
|
| 74 |
for i in new_name:
|
| 75 |
url = f"{i} site:en.wikipedia.org"
|
| 76 |
+
s = search(url, num_results = 12, lang="en")
|
| 77 |
+
for i in s:
|
| 78 |
data.add(i.split("/")[-1])
|
| 79 |
return data
|
| 80 |
|
|
|
|
| 85 |
|
| 86 |
async with aiohttp.ClientSession() as session:
|
| 87 |
url = f"{name} site:en.wikipedia.org"
|
| 88 |
+
s = search(url, num_results = 30, lang="en")
|
| 89 |
+
for i in s:
|
| 90 |
data.add(i.split("/")[-1])
|
| 91 |
|
| 92 |
wikipedia_url = f"https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch={name}&srlimit=1&srprop=&srenablerewrites=True&srinfo=suggestion&format=json"
|