diff --git a/Docker/README.md b/Docker/README.md index 8b0f7c7..f43e83d 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -9,7 +9,7 @@ - Create a virtual environment for Python 2.7 ```$ virtualenv pythenv --python=python2 ``` - Run the virtual environment ```$ source pythenv/bin/activate``` - Install the dependencies ```$ pip install elasticsearch SPARQLWrapper simplejson gensim pandas flask nltk ``` - ```pip install -U scikit-learn``` + ```$ pip install -U scikit-learn``` - Run ```$ python IndexSDAKG.py ``` to import all the entities and labels of the KG to ElasticSearch (This is needed only when the KG is being updated or it is the first time). - Download [wiki-en.bin fasttext](https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.en.zip) - Move the wiki.en.bin file into the data folder of the project. @@ -26,7 +26,7 @@ $ docker run -d --name qaunibonn_fuseki -p 3030:3030 -e ADMIN_PASSWORD=robot -v ``` ## Start ElasticSearch Server Docker -- Pull Docker Fuseki Server +- Pull Docker ElasticSearch Server ```sh $ docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2 ``` @@ -35,7 +35,7 @@ $ docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2 $ docker run -d --name elasticsearch -e transport.host=0.0.0.0 -e cluster.name=elasticsearch -e http.host=0.0.0.0 -e xpack.security.enabled=false -it docker.elastic.co/elasticsearch/elasticsearch:6.3.2 ``` -If server does not connect with the container of ElasticSearch +If server does not connect with the container of ElasticSearch Server ```sh $ 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 ``` diff --git a/Documentation/CompleteDocumentation.md b/Documentation/CompleteDocumentation.md new file mode 100644 index 0000000..2a46fa5 --- /dev/null +++ b/Documentation/CompleteDocumentation.md @@ -0,0 +1,78 @@ +# Documentation of QAUniBonn + +## List of dependencies +- Docker + +## Steps of instalation +1. Download or clone the Git repository +```sh +$ git clone https://github.com/jtrillos/QAUniBonn.git +``` + +### Fuseki Server +2. Pull Docker Fuseki Server +```sh +$ docker pull stain/jena-fuseki +``` +2. a. Run Docker Fuseki Server +```sh +$ docker run -d --name qaunibonn_fuseki -p 3030:3030 -e ADMIN_PASSWORD=robot -v /path/to/Docker/Fuseki_TripleStore/:/fuseki/ -it stain/jena-fuseki +``` +2. b. Download and extract [Apache Jena Fuseki](http://archive.apache.org/dist/jena/binaries/apache-jena-fuseki-3.4.0.zip) +2. c. Go to apache-jena-fuseki-3.4.0/bin and run the command s-put +```sh +$ ./s-put http://localhost:3030/kommunikationroboter/data http://sda.tech/ path/to/Docker/Fuseki_TripleStore/backups/sda.tech.ttl +``` +This process add the Knowledge Graph of SDA in a graph "http://sda.tech/" inside the TripleStore "kommunikationroboter". + +### ElasticSearch +3. Pull Docker ElasticSearch +```sh +$ docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2 +``` +3. a. Run Docker ElasticSearch +```sh +$ 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 +``` + +### QAUniBonn Repository +4. Install python 2.7 and virtualenv +4. a. Create a virtual environment +```sh +$ virtualenv pythenv --python=python2 +``` +4. b. Run the virtual environment +```sh +$ source pythenv/bin/activate +``` +4. c. Install the dependencies +```sh +$ pip install elasticsearch SPARQLWrapper simplejson gensim pandas flask nltk +``` +```sh +$ pip install -U scikit-learn +``` +5. Download [wiki-en.bin fasttext](https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.en.zip) +5. a. Move the wiki-en.bin file into the "data" forlder of the project +6. If there is no data of NLTK in the server, uncomment the lines 8 - 11 in nerQuestion.py +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). +```sh +$ python IndexSDAKG.py +``` + +## Run the server +- To run the server +```sh +$ python app.py +``` +- To run the server in background +```sh +$ nohup python app.py & +``` +## Example of API: +```sh +$ curl -i -H "Content-Type: application/json" -X POST -d '{"question":"Where is SDA?"}' http://localhost:8000/ask +``` + +### For more information of API +Go to the Documentation folder. \ No newline at end of file diff --git a/README.md b/README.md index 80118f6..2ba8387 100755 --- a/README.md +++ b/README.md @@ -16,14 +16,12 @@ - Create a virtual environment for Python 2.7 ```$ virtualenv pythenv --python=python2 ``` - Run the virtual environment ```$ source pythenv/bin/activate``` - Install the dependencies ```$ pip install elasticsearch SPARQLWrapper simplejson gensim pandas flask nltk ``` - ```pip install -U scikit-learn``` + ```$ pip install -U scikit-learn``` - Run ```$ python IndexSDAKG.py ``` to import all the entities and labels of the KG to ElasticSearch (This is needed only when the KG is being updated or it is the first time). - Download [wiki-en.bin fasttext](https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.en.zip) - Move the wiki.en.bin file into the data folder of the project. - If there is not data of nltk uncomment the lines 8 - 11 in nerQuestion.py -If there is no data of nltk uncomment the lines 8 - 11 in nerQuestion.py - ## Run Server: To run the server ```sh