UKPLab / coling2018-graph-neural-networks-question-answering

Accompanying code for our COLING 2018 paper "Modeling Semantics with Gated Graph Neural Networks for Knowledge Base Question Answering"
Apache License 2.0
173 stars 29 forks source link

wikidata #1

Open huiwudiyi opened 5 years ago

huiwudiyi commented 5 years ago

when I run runserver.py .I found a error in "questionanswering/grounding/graph_queries.py"

from wikidata import scheme, endpoint_access, queries ImportError: cannot import name 'scheme'

I have already installed wikidata.

daniilsorokin commented 5 years ago

Hi,

some of our internal packages are still missing from the code. It was initially published to give more insights into the paper and the experiments.

We are planing with the missing parts to update it in October to support the training and running pre-trained models. Sorry for the inconvenience!

Best, Daniil

huiwudiyi commented 5 years ago

ok ,look forward to your update!

daniilsorokin commented 5 years ago

Hi, I have finally added a lot of additional info on required internal packages and Wikidata endpoint. Will expand on it even further, but let me know if need anything specific.

BettyHcZhang commented 5 years ago

Hi,Thank you for your share. I have followed your instructions above. I download the zip of wikidata ,Unfortunately I get the error as below: File "/home/coling2018-graph-neural-networks-question-answering/questionanswering/grounding/graph_queries.py", line 6, in from wikidata import scheme, endpoint_access, queries File "/home/coling2018-graph-neural-networks-question-answering/wikidata/endpoint_access.py", line 4, in from SPARQLWrapper import SPARQLWrapper, JSON ModuleNotFoundError: No module named 'SPARQLWrapper'

Actually,I just want to run through the model to see the entire workflow. Just for quick understand the paper better. In fact, I do not need the final model.

daniilsorokin commented 5 years ago

Hi,

try installing SPARQLWrapper with:

pip install SPARQLWrapper

Best, Daniil

BettyHcZhang commented 5 years ago

Thank you very much!

daniilsorokin commented 5 years ago

Sure, get it here: https://public.ukp.informatik.tu-darmstadt.de/coling2018-graph-neural-networks-question-answering/webqsp.examples.train.silvergraphs.02-12.el.unittest.json

and put into data/generated/ folder.

BettyHcZhang commented 5 years ago

Thank you for your help. I have another question about how the GNN used in semantic graph. Suppose that: we use simple GNN model: f=f(AHW). A is adjacent matrix of nodes.H is embedding of labels. W is wights matrix. Vg=ReLU(Wh + b). Loss as your paper. For one question , we have N candidate graphs.Then we have N Vg output.So we trained the wights matrix(W) by SGD on each f(AHW). Then We have N trained graph model. Then , I have a new question, it has M candidate graphs.How to use previous trained model to get the right answer?Which model should I use in those N graph model? Looking forward to your reply!

daniilsorokin commented 4 years ago

To answer your question: you do not train N graph models, you train a single model that is applied across all graphs.

blackkingback commented 4 years ago

Hey gusy,what's up!I try to run runserver.py,but I can not find the qaserver.pyt under questionanswering folder.Did I miss something?

purvanshi commented 4 years ago

@daniilsorokin Is there any update on a newer version of the code with required dependencies?

Dinxin commented 2 years ago

@daniilsorokin I have got this error: ImportError: cannot import name 'queries' from 'wikidata' (/root/anaconda3/envs/nlp/lib/python3.8/site-packages/wikidata/init.py)

So, how to install the python module named "wikidata"?

The command I adopted is "pip install wikidata".