Spaces:
Sleeping
Sleeping
ganeshkamath89
commited on
Commit
•
084837c
1
Parent(s):
cb38464
Adding user example to Wikipedia API()
Browse files
app.py
CHANGED
@@ -5,13 +5,11 @@ import nltk
|
|
5 |
nltk.download('punkt')
|
6 |
|
7 |
def get_wiki_summary(search):
|
8 |
-
wiki_wiki = wikipediaapi.Wikipedia('en')
|
9 |
page = wiki_wiki.page(search)
|
10 |
-
|
11 |
isExist = page.exists()
|
12 |
if not isExist:
|
13 |
return isExist, "Not found", "Not found", "Not found", "Not found"
|
14 |
-
|
15 |
url = page.fullurl
|
16 |
tittle = page.title
|
17 |
summary = page.summary[0:60]
|
|
|
5 |
nltk.download('punkt')
|
6 |
|
7 |
def get_wiki_summary(search):
|
8 |
+
wiki_wiki = wikipediaapi.Wikipedia('MyProjectName (merlin@example.com)', 'en')
|
9 |
page = wiki_wiki.page(search)
|
|
|
10 |
isExist = page.exists()
|
11 |
if not isExist:
|
12 |
return isExist, "Not found", "Not found", "Not found", "Not found"
|
|
|
13 |
url = page.fullurl
|
14 |
tittle = page.title
|
15 |
summary = page.summary[0:60]
|