percyliang / sempre

Semantic Parser with Execution
Other
829 stars 300 forks source link

Using SEMPRE with knowledge graphs other than Freebase #72

Open talach opened 9 years ago

talach commented 9 years ago

Hi, I would like to use SEMPRE for semantic parsing on my own database/graph which is not related to Freebase. I tried to change the tutorial.ttl, tutorial.grammar and tutorial.lexicon files to fit a toy example of my graph but run into several errors. The changes I tried are removing anything related to freebase such as the line: @prefix fb: http://rdf.freebase.com/ns/. (could you explain the meaning of this line?) and special prefixes "fb:","en." etc from the tutorial.ttl file.

What changes should I be making instead?

Thanks!

mr-asleep commented 4 years ago

Hi. I am facing the same issue. Could you suggest how to add a sample graph file of any other database such as dbpedia and its lexicon, grammar files to query just like it is mentioned in the tutorial. Thanks

ppasupat commented 4 years ago

I'm less familiar with the freebase module. But for a smaller database (< 10K relations), there is an example in the geo880 mode:

./pull-dependencies core corenlp tables geo880
ant geo880
./run @mode=geo880

This loads the whole knowledge graph in lib/data/geo880 to memory, and query it with a built-in executor (instead of building a SPARQL query for an external server).