Skip to content

Latest commit

 

History

History
70 lines (59 loc) · 2.82 KB

docker_run.md

File metadata and controls

70 lines (59 loc) · 2.82 KB

Run KGQAn in Dockerized environment

Prerequisites

docker compose version
  • If Docker Compose is not installed, you can follow the instructions to install it:
  • Install Docker Compose
  • Used docker version : 24.0.7
  • Used docker compose version : v2.21.0
  • Use docker compose v2 (new go based utility) not docker-compose v1 (python based)
  • Used OS : Ubuntu : 20.06.6 LTS Focal Fossa

Setup Instructions

  1. Clone the repository:
git clone https://github.com/CoDS-GCS/KGQAn.git
cd KGQAn

Download the required data/models:

  • Run the following command to execute the data download script:
  • This script will download the trained models and any necessary data for the services.
# run in docker environment
./data_download.sh docker

Note : KGQAn server depends on Word Embedding Server, Word Embedding server takes arround ~3.5 minute time to load w2v file. So there is 300 seconds delay in docker run.

Build and run the services using Docker Compose:

  • ** There is wait time of 300 sec, for model loading before starting server or evaluation scripts**
  • Make sure you are in the root directory of the project.
  • To start KGQAn in server mode use docker-compose-server.yml
docker compose -f docker-compose-server.yml up --build
  • To start KGQAn in evaluation mode use docker-compose-evaluation.yml
docker compose -f docker-compose-evaluation.yml up --build
  • If you faced any error running the previous docker compose commands due to a versioning error, adjust the version paramater in the .yml file according to your version of docker-compose: https://docs.docker.com/compose/compose-file/compose-versioning/
  • The evaluation results for benchmarks [QALD, DBLP, LCQUAD, YAGO, MAG] will be stored in src/evaluation/output/evaluation_results.csv
  • It will be in below format
Benchmark Name
P, R, F1
xx, xx, xx

Access the services (Start in server mode):

  • Once the Docker containers are up and running, you can access the services using the specified URLs or ports.
curl -X POST -H "Content-Type: application/json" -d '{"question": "Who founded Intel?", "knowledge_graph":"dbpedia", "max_answers": 3}' localhost:8899

Clean up:

  • To stop and remove the running Docker containers, use the following command:
docker compose down