Skip to content
Snippets Groups Projects
Commit 1c8ba7a8 authored by Albin's avatar Albin
Browse files

json.file with all relations (predicates) in dbpedia

parent 59962e7c
No related branches found
No related tags found
No related merge requests found
import requests
API_URL = "https://rel.cs.ru.nl/api"
def example():
text_doc = "If you're going to try, go all the way - Charles Bukowski"
# Example EL.
el_result = requests.post(API_URL, json={
"text": text_doc,
"spans": []
}).json()
# Example ED.
ed_result = requests.post(API_URL, json={
"text": text_doc,
"spans": [(41, 16)]
}).json()
print("el_result", el_result)
print("ed_result", ed_result)
def link_question(question):
el_result = requests.post(API_URL, json={
"text": question,
"spans": []
}).json()
return el_result
def multi_qestions(questions):
for question in questions:
el_result = link_question(question)
print("el_result", el_result)
if __name__ == '__main__':
example()
questions = [
"List all boardgames by GMT.",
"What is the time zone of Salt Lake City?",
"Who developed Skype?",
"What is the last work of Dan Brown?",
"Where is Sungkyunkwan University?"
]
#multi_qestions(questions)
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment