StarGraph Disambiguation
Running
The code for the StarGraph based disambiguation module can be found at:
https://github.com/andrenfreitas/okbqa-stargraph-disambiguator
Running instructions:
Run the following to start: mvn clean install exec:java
Then access the service locally.
Within the OKBQA infrastructure the service can be reached at:
http://121.254.173.77:2359/stargraph_disambiguation/run
An example of a valid input is (output of the template generation module):
{
"question": "What is the capital of France?",
"query": "SELECT ?v2 WHERE { ?v1 ?p1 ?v2 . } ",
"slots": [ {"s": "v1", "p": "verbalization", "o": "France"},
{"s": "v1", "p": "is", "o": "owl:NamedIndividual"},
{"s": "p1", "p": "verbalization", "o": "capital"},
{"s": "p1", "p": "is", "o": "owl:DatatypeProperty"}
],
"score": 0.8
}
http://localhost:2357/stargraph_disambiguation/run?data={"question": "What is the capital of France?", "query": "SELECT ?v2 WHERE { ?v1 ?p1 ?v2 . } ", "slots": [ {"s": "v1", "p": "verbalization", "o": "France"}, {"s": "v1", "p": "is", "o": "owl:NamedIndividual"}, {"s": "p1", "p": "verbalization", "o": "capital"}, {"s": "p1", "p": "is", "o": "owl:DatatypeProperty"} ], "score": 0.8 }
You can test on the service available at the OKBQA server:
http://121.254.173.77:2359/stargraph_disambiguation/run?data={"question": "What is the capital of France?", "query": "SELECT ?v2 WHERE { ?v1 ?p1 ?v2 . } ", "slots": [ {"s": "v1", "p": "verbalization", "o": "France"}, {"s": "v1", "p": "is", "o": "owl:NamedIndividual"}, {"s": "p1", "p": "verbalization", "o": "capital"}, {"s": "p1", "p": "is", "o": "owl:DatatypeProperty"} ], "score": 0.8 }
Examples of Input and Output
----------------------------------------------------------
{"question":"What is the capital of France?","ned":[{"score":1,"entities":[{"score":1.0,"var":"v1","value":"http:\/\/dbpedia.org\/resource\/France"}],"properties":[{"score":0.5291877956337697,"var":"p1","value":"http:\/\/dbpedia.org\/ontology\/largestCity"},{"score":0.51423811118566,"var":"p1","value":"http:\/\/dbpedia.org\/property\/city"}]}]}
----------------------------------------------------------
{"question":"Who is the mother of Jesus?","ned":[{"score":1,"entities":[{"score":1.0,"var":"v1","value":"http:\/\/dbpedia.org\/resource\/Jesus"}],"properties":[{"score":0.7715287525611708,"var":"p1","value":"http:\/\/dbpedia.org\/property\/parents"},{"score":0.7715287525611708,"var":"p1","value":"http:\/\/dbpedia.org\/ontology\/parent"}]}]}
----------------------------------------------------------
{"question":"Which mountains are in Seoul?","ned":[{"score":1,"entities":[{"score":1.0,"var":"v1","value":"http:\/\/dbpedia.org\/resource\/Seoul"}],"properties":[{"score":0.4988894718498954,"var":"p1","value":"http:\/\/dbpedia.org\/ontology\/locatedInArea"},{"score":0.4533820388868726,"var":"p1","value":"http:\/\/dbpedia.org\/property\/locationTown"}]}]}
----------------------------------------------------------
{"question":"What is the national flower of South Korea?","ned":[{"score":1,"entities":[{"score":1.0,"var":"v1","value":"http:\/\/dbpedia.org\/resource\/South_Korea"}],"properties":[{"score":0.5353984830867025,"var":"p1","value":"http:\/\/dbpedia.org\/property\/nation"},{"score":0.5353984830867025,"var":"p1","value":"http:\/\/dbpedia.org\/property\/national"}]}]}
----------------------------------------------------------
{"question":"Where is the Great Synagogue of Israel?","ned":[{"score":1,"entities":[{"score":0.16666666666666666,"var":"v1","value":"http:\/\/dbpedia.org\/resource\/Great_Synagogue_of_Rome"}],"properties":[{"score":0.3734233463643491,"var":"p1","value":"http:\/\/www.georss.org\/georss\/point"},{"score":0.262277482701692,"var":"p1","value":"http:\/\/dbpedia.org\/property\/buildingName"}]}]}
----------------------------------------------------------
{"question":"Who was the Russian physiologist that won the Nobel Prize for Physiology or Medicine in 1904?","ned":[{"score":1,"entities":[{"score":0.08333333333333333,"var":"v1","value":"http:\/\/dbpedia.org\/resource\/Nobel_Prize_in_Physiology_or_Medicine"}],"properties":[{"score":0.5608968208029161,"var":"p1","value":"http:\/\/dbpedia.org\/ontology\/award"},{"score":0.5608968208029161,"var":"p1","value":"http:\/\/dbpedia.org\/property\/awards"}]}]}
On StarGraph and Indra
For the documentation on the StarGraph REST service API please click here.
Example ipython notebook is here.
Example python code is here.
Example java code is here.
You can find the documentation of the Indra REST service API here.
Example ipython notebook is here.
Example python code is here.
Example java code is here.