-
Docker: Ensure that you have Docker installed on your machine. If not, follow the installation instructions specific to your operating system:
-
Docker Compose: Verify that you have Docker Compose installed by running the following command:
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 composeversion : v2.21.0 - Use
docker composev2 (new go based utility) notdocker-composev1 (python based) - Used OS : Ubuntu : 20.06.6 LTS Focal Fossa
- Clone the repository:
git clone https://github.com/CoDS-GCS/KGQAn.git
cd KGQAn- 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 dockerNote : 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.
- ** 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 composecommands due to a versioning error, adjust the version paramater in the.ymlfile 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- 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- To stop and remove the running Docker containers, use the following command:
docker compose down