Skip to content

Commit b835c59

Browse files
committed
adding documentation
1 parent 6e4ec2e commit b835c59

File tree

3 files changed

+82
-6
lines changed

3 files changed

+82
-6
lines changed

Docker/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- Create a virtual environment for Python 2.7 ```$ virtualenv pythenv --python=python2 ```
1010
- Run the virtual environment ```$ source pythenv/bin/activate```
1111
- Install the dependencies ```$ pip install elasticsearch SPARQLWrapper simplejson gensim pandas flask nltk ```
12-
```pip install -U scikit-learn```
12+
```$ pip install -U scikit-learn```
1313
- 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).
1414
- Download [wiki-en.bin fasttext](https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.en.zip)
1515
- 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
2626
```
2727

2828
## Start ElasticSearch Server Docker
29-
- Pull Docker Fuseki Server
29+
- Pull Docker ElasticSearch Server
3030
```sh
3131
$ docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2
3232
```
@@ -35,7 +35,7 @@ $ docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2
3535
$ 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
3636
```
3737

38-
If server does not connect with the container of ElasticSearch
38+
If server does not connect with the container of ElasticSearch Server
3939
```sh
4040
$ 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
4141
```
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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.

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
- Create a virtual environment for Python 2.7 ```$ virtualenv pythenv --python=python2 ```
1717
- Run the virtual environment ```$ source pythenv/bin/activate```
1818
- Install the dependencies ```$ pip install elasticsearch SPARQLWrapper simplejson gensim pandas flask nltk ```
19-
```pip install -U scikit-learn```
19+
```$ pip install -U scikit-learn```
2020
- 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).
2121
- Download [wiki-en.bin fasttext](https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.en.zip)
2222
- Move the wiki.en.bin file into the data folder of the project.
2323
- If there is not data of nltk uncomment the lines 8 - 11 in nerQuestion.py
2424

25-
If there is no data of nltk uncomment the lines 8 - 11 in nerQuestion.py
26-
2725
## Run Server:
2826
To run the server
2927
```sh

0 commit comments

Comments
 (0)