Usage

Installation

NeuralQA can be installed via pip using the following command:

pip3 install neuralqa

Viewing the UI

neuralqa ui --port 5000 --workers 1

Note

NeuralQA uses the uvicorn asgi webserver with support for multiple workers (use the worker flag to set the number of worker processes). Note that model weights used by NeuralQA are loaded into memory on status for each thread.

NeuralQA User Interface Screenshot

Command Line Options

The primary command for NeuralQA is neuralqa ui, used to launch the web interface. Use the following command to view the available options.

neuralqa ui --help
Usage: neuralqa ui [OPTIONS]

This command launches the web interface for NeuralQA.

Options:
-h, --host TEXT          The network address to listen on (default:
                        127.0.0.1). Use 0.0.0.0 to bind to all addresses if
                        you want to access the tracking server from other
                        machines.

-p, --port INTEGER       The port to listen on (default: 5000).
-w, --workers INTEGER    Number of uviicorn worker processes to handle
                        requests (default: 1).

-cp, --config-path TEXT  Path to a yaml file containing config for neuralqa.
                        If none is provided, the default config.yaml is
                        copied to the current directory.

--help                   Show this message and exit.

Rest API Docs

The rest api for NeuralQA is implemented using FastAPI. This means you do get excellent documentation for free. In your browser, type the following:

localhost:port/api/docs

Loading Sample Data

NeuralQA provides a method to download and import sample data (court case documents) into a local elasticsearch index. The command below will import the first 10,000 documents from the case law dataset for new mexico.

neuralqa load --max-docs 10000