Spaces:
Sleeping
Sleeping
Initial commit - clean setup for HF Space
Browse files
Graphs.py
CHANGED
|
@@ -70,7 +70,7 @@ Text: {text}"""
|
|
| 70 |
|
| 71 |
|
| 72 |
def build_kg_from_wiki_title(title, lang="en", chunk_chars=800, max_triples_per_chunk=5):
|
| 73 |
-
wiki = wikipediaapi.Wikipedia(lang)
|
| 74 |
page = wiki.page(title)
|
| 75 |
if not page.exists():
|
| 76 |
return []
|
|
|
|
| 70 |
|
| 71 |
|
| 72 |
def build_kg_from_wiki_title(title, lang="en", chunk_chars=800, max_triples_per_chunk=5):
|
| 73 |
+
wiki = wikipediaapi.Wikipedia(lang, user_agent = "MyKGApp/1.0 (contact: your_email@example.com)")
|
| 74 |
page = wiki.page(title)
|
| 75 |
if not page.exists():
|
| 76 |
return []
|