Capturing Analytical Intents from Text
-
You should have Docker installed on your machine.
-
You should have
.env
file in the root folder with your API keys stored.OPENAI_API_KEY=<YOUR OPENAI_API_KEY> LlamaAPI_KEY=<LlamaAPI_KEY>
For more information on how to obtain API Keys, refer to : OpenAI and LLama AI.
In order to build a Docker image yourself run the following command.
# run build Docker command
docker build . -t <image-name>:<image-tag>
Based on your platform installation you may need to use sudo
or other platform
specific adjustments.
Make sure that you do not have put any private data in the current folder as it will be added to the Docker image you created and as such available to anyone who come in position of the image.
For starting Docker container we can use the docker
commands.
# run container
docker run --rm -p 9000:9000 --name='<container-name>' <image-name>:<image-tag>
# build docker image
docker build -t intent-detect:latest .
# run container
docker run --rm -p 9000:9000 --name='intent-detect-c1' intent-detect:latest
Optionally, you can run the container such that your local host is mounted to the Docker container to keep track of input and output files. This way, all input data and results are saved to your local host upon container termination.
# run container (local host is mounted to the Docker container)
docker run --rm -p 9000:9000 -v $PWD/src/results:/src/results -v $PWD/src/uploads:/src/uploads --name='intent-detect-c1' intent-detect:latest
If needed you can connect to running Docker container.
# connect to started container
docker exec -it intent-detect-c1 /bin/sh
In order to engage with application you should navigate your web browser to
http://localhost:9000
or you can use curl
.
curl -X GET http://localhost:9000