This is a simple Demo of how to use RocketQA together with Jina. Jina is a Cloud-native neural search framework for any kind of data
Prerequisites: Make sure
dockeris installed and running on your machine
# delete this line once the docker image is published
docker build -t rocketqa-jina -f docker/cpu/Dockerfile .
docker run --rm -it -v "$(pwd)/workspace:/rocketqa/workspace" -v "$(pwd)/model:/root/.rocketqa" rocketqa-jina:latest indexThe above codes will download the models to model folder and index the data at toy_data/test.tsv from the Docker image. The index will be stored at workspace folder. You can start asking questions via your browser by running the following command and open workspace/static/index.html in your browser.
docker run --rm -it -v "$(pwd)/workspace:/rocketqa/workspace" -v "$(pwd)/model:/root/.rocketqa" -p 8886:8886 rocketqa-jina:latest queryIf you prefer to use CLI, please run
docker run --rm -it -v "$(pwd)/workspace:/rocketqa/workspace" -v "$(pwd)/model:/root/.rocketqa" rocketqa-jina:latest query_clicd examples/jina_example
pip install -r requirements.txtRun the following line to index the data stored at toy_data/test.tsv
python app.py index toy_data/test.tsvThe data is formatted as below
title_1\ttext_1\n
title_2\ttext_2\n
...
Run the following line to start the query service. You will have a demo page opened in your browser. By default, port 8889 is used.
python app.py queryIf you prefer to use the shell, please try
python app.py query_cliIf you have GPUs, please set export JINA_USE_CUDA=True.