|
| 1 | +# Documentation of QAUniBonn |
| 2 | + |
| 3 | +## List of dependencies |
| 4 | +- Docker |
| 5 | + |
| 6 | +## Steps of instalation |
| 7 | +1. Download or clone the Git repository |
| 8 | +```sh |
| 9 | +$ git clone https://github.com/jtrillos/QAUniBonn.git |
| 10 | +``` |
| 11 | + |
| 12 | +### Fuseki Server |
| 13 | +2. Pull Docker Fuseki Server |
| 14 | +```sh |
| 15 | +$ docker pull stain/jena-fuseki |
| 16 | +``` |
| 17 | +2. a. Run Docker Fuseki Server |
| 18 | +```sh |
| 19 | +$ docker run -d --name qaunibonn_fuseki -p 3030:3030 -e ADMIN_PASSWORD=robot -v /path/to/Docker/Fuseki_TripleStore/:/fuseki/ -it stain/jena-fuseki |
| 20 | +``` |
| 21 | +2. b. Download and extract [Apache Jena Fuseki](http://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-3.4.0.zip) |
| 22 | +2. c. Go to apache-jena-fuseki-3.4.0/bin and run the command s-put |
| 23 | +```sh |
| 24 | +$ ./s-put http://localhost:3030/kommunikationroboter/data http://sda.tech/ path/to/Docker/Fuseki_TripleStore/backups/sda.tech.ttl |
| 25 | +``` |
| 26 | +This process add the Knowledge Graph of SDA in a graph "http://sda.tech/" inside the TripleStore "kommunikationroboter". |
| 27 | + |
| 28 | +### ElasticSearch |
| 29 | +3. Pull Docker ElasticSearch |
| 30 | +```sh |
| 31 | +$ docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2 |
| 32 | +``` |
| 33 | +3. a. Run Docker ElasticSearch |
| 34 | +```sh |
| 35 | +$ docker run -d --name qaunibonn_elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.3.2 |
| 36 | +``` |
| 37 | + |
| 38 | +### QAUniBonn Repository |
| 39 | +4. Install python 2.7 and virtualenv |
| 40 | +4. a. Create a virtual environment |
| 41 | +```sh |
| 42 | +$ virtualenv pythenv --python=python2 |
| 43 | +``` |
| 44 | +4. b. Run the virtual environment |
| 45 | +```sh |
| 46 | +$ source pythenv/bin/activate |
| 47 | +``` |
| 48 | +4. c. Install the dependencies |
| 49 | +```sh |
| 50 | +$ pip install elasticsearch SPARQLWrapper simplejson gensim pandas flask nltk |
| 51 | +``` |
| 52 | +```sh |
| 53 | +$ pip install -U scikit-learn |
| 54 | +``` |
| 55 | +5. Download [wiki-en.bin fasttext](https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.en.zip) |
| 56 | +5. a. Move the wiki-en.bin file into the "data" forlder of the project |
| 57 | +6. If there is no data of NLTK in the server, uncomment the lines 8 - 11 in nerQuestion.py |
| 58 | +7. Run Client/IndexSDAKG python file to import all the entities and labels of the Knowledge Graph to ElasticSearch (This process is done once or when the Knowledge Graph has been updated). |
| 59 | +```sh |
| 60 | +$ python IndexSDAKG.py |
| 61 | +``` |
| 62 | + |
| 63 | +## Run the server |
| 64 | +- To run the server |
| 65 | +```sh |
| 66 | +$ python app.py |
| 67 | +``` |
| 68 | +- To run the server in background |
| 69 | +```sh |
| 70 | +$ nohup python app.py & |
| 71 | +``` |
| 72 | +## Example of API: |
| 73 | +```sh |
| 74 | +$ curl -i -H "Content-Type: application/json" -X POST -d '{"question":"Where is SDA?"}' http://localhost:8000/ask |
| 75 | +``` |
| 76 | + |
| 77 | +### For more information of API |
| 78 | +Go to the Documentation folder. |
0 commit comments