Watch the tutorial video at here.
This repo was forked from here.
The original build process is outlined here.
I tried to dockerize things as much as possible so that you can just pull the image and run it on your desired machine.
-
Pull the latest image by
docker pull tae898/conceptnet5
Check out the original Dockerfile of this image, if interested.
-
Run the docker container in detached mode. This will start
postgres
within.docker run --name conceptnet5 --network host -d tae898/conceptnet5
-
Open up zsh (or bash, whatever you prefer) in the container by running
docker exec -it conceptnet5 zsh
-
Create a PostgreSQL database named conceptnet5 by running
createdb conceptnet5
-
Start the build by running
./build.sh
This will take a long time since it has to download all the data. You need at least 30 GB of available RAM, 300 GB of free disk space, and the time and bandwidth to download 24 GB of raw data.
-
Run the web server
cd web pip install -e . python3 conceptnet_web/api.py
-
Now you are ready to play around with the API!
Try: http://127.0.0.1:8084/c/en/laptop?rel=/r/AtLocation&limit=1000
Any HTTP request with the original server (e.g., https://conceptnet.io/c/en/laptop?rel=/r/AtLocation&limit=1000) will work on your local machine now. The only difference is that now the external server https://conceptnet.io is replaced with your local server http://127.0.0.1:8084.
-
You can also make HTTP requests from a python client. Take a look at the client.py
Be sure to install the requests package by running
pip install requests
-
When you are done with the API, you can safely turn off the Flask server and kill the docker container by
docker kill conceptnet5
-
When you are done you can just kill the container. And when you wanna start again, first run
docker start conceptnet5
Now the container
conceptnet5
started in detached mode. Now run the Flask API server bydocker exec -it -w /conceptnet5/web conceptnet5 python3 conceptnet_web/api.py
-
Again when you are done, kill the container by
docker kill conceptnet5
The best way to find and solve your problems is to see in the github issue tab. If you can't find what you want, feel free to raise an issue. We are pretty responsive.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Run
make style && make quality
in the root repo directory, to ensure code quality. - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request