brmson / yodaqa

A Question Answering system built on top of the Apache UIMA framework.
http://ailao.eu/yodaqa
Other
619 stars 205 forks source link

Added capability to dynamically change data backends. #47

Closed k0105 closed 8 years ago

k0105 commented 8 years ago

Hi Petr,

here are the changes to swap data backends. Could you take a look?

Thanks in advance.

Best wishes, Joe

k0105 commented 8 years ago

Careful with my pull request. Please don't accept it quite yet. I just ran into a connection problem with my containers. I'm not sure what causes this, yet, so I must assume it might have something to do with this code. I'll let you know when it works.

pasky commented 8 years ago

Thanks for taking another look. Sorry for not attending to this, I was fully occupied by finishing a paper (deadline tonight) as well as Ailao-related reorgs. I should be able to wrangle GitHub PRs much more quickly again from now on... :)

k0105 commented 8 years ago

Seems like I was just being stupid. It should work with a command like

./gradlew web -Dcz.brmlab.yodaqa.dbpediaurl="http://127.0.0.3037/dbpedia/query" -Dcz.brmlab.yodaqa.freebaseurl="http://127.0.0.1:3030/freebase/query" -Dcz.brmlab.yodaqa.solrurl="http://127.0.0.1:8983/solr" -Dcz.brmlab.yodaqa.label1url="http://127.0.0.1:5000" -Dcz.brmlab.yodaqa.label2url="http://127.0.0.1:5001" -q

Try it - if it works on your machine as well it should be solid enough to accept the pull request. Btw.: You can see the URLs the system uses under http://localhost:4567/dataUrls

PS: When I work on your project with IntelliJ I need a gradle.properties file with org.gradle.java.home = /opt/ibm/java-x86_64-80 (path to my JDK) - otherwise I get some Java home error. Not sure what to make of it. I'll most likely just modify the corresponding wiki page. It should be updated, anyways - the process is now much simpler.

k0105 commented 8 years ago

Hm, I can't reopen the pull request myself.

pasky commented 8 years ago

...I can't reopen it either, because "The repository that submitted this pull request has been deleted."

k0105 commented 8 years ago

Heh :D So you want me to send a new pull request? [You should still be able to use this one from what I understand?] Btw.: My problems from earlier also came from the fact that I accessed the services via localhost. It is much more advisable to use Docker links instead. Something like

dbpedia:
  image: fuseki
  ports:
   - "3037:3037"
  volumes:
   - /media/fp/DataBackends/data/db/:/jena-fuseki-1.1.1/db/
  command: ./fuseki-server --port 3037 --loc db /dbpedia

enwiki:
  image: solr
  ports:
   - "8983:8983"
  volumes:
   - /media/fp/DataBackends/data/enwiki/collection1/:/solr-4.6.0/example/enwiki/collection1/
  command: java -Dsolr.solr.home=enwiki -jar start.jar

freebase:
  image: fuseki
  ports:
   - "3030:3030"
  volumes:
   - /media/fp/DataBackends/data/d-freebase/:/jena-fuseki-1.1.1/d-freebase/
  command: ./fuseki-server --loc d-freebase /freebase

label1:
  image: labels
  ports:
   - "5000:5000"
  volumes:
   - /media/fp/DataBackends/data/labels/:/shared
  command: pypy /label-lookup/lookup-service.py /shared/sorted_list.dat

label2:
  image: labels
  ports:
   - "5001:5001"
  volumes:
   - /media/fp/DataBackends/data/labels/:/shared
  command: pypy /label-lookup/lookup-service-sqlite.py /shared/labels.db

webqa:
  image: webqa
  ports:
   - "4000:4000"
  command: ./gradlew runRestBackend

yoda_offline:
  image: yoda_offline_tested
  links:
   - enwiki:enwiki
   - dbpedia:dbpedia
   - freebase:freebase
   - label1:label1
   - label2:label2
  ports:
   - "4567:4567"
  command: ./gradlew web -q -Dcz.brmlab.yodaqa.dbpediaurl="http://dbpedia:3037/dbpedia/query" -Dcz.brmlab.yodaqa.freebaseurl="http://freebase:3030/freebase/query" -Dcz.brmlab.yodaqa.solrurl="http://enwiki:8983/solr" -Dcz.brmlab.yodaqa.label1url="http://label1:5000" -Dcz.brmlab.yodaqa.label2url="http://label2:5001"

works fine on my machine. And webqa is the ensemble that I will release as soon as it's tidied up (read: next week).

pasky commented 8 years ago

Hmm, I suppose I could dig it up somehow given the commit id and github not pruning this yet, but I'm not completely sure of that, so if you could create a new PR, that'd make my life easier, yes. :) Thanks!

k0105 commented 8 years ago

Will do. I will wait for about two days and send you my ensemble and the updated Dockerfiles simultaneously (but separately, of course). For instance, DBpedia and Freebase are now one container, which is much cleaner. Ideally, YodaQA users can soon type docker-compose up and are greeted with a working local system. The Thrift interface also works already, so it should be trivial to link the project with Lucida. Finally, I'm currently rewriting everything (which is why it took me an additional two weeks), so the code is cleaner and independent of JavaFX and similar dependencies. I'm beginning to like it and I have some nice additions in the pipeline. They say it takes you half a year to become good at a job. I feel like that's where I am. And thanks so much to your boss - I knew he was a genius, now I also know that he has connections. Impressive man.