The CLI allows you to download comments and predictions in batch. This is most useful to script import into analytics tools that don't require a live connection.
Which model version does the CLI tool use to get predictions?
The CLI tool will download the latest available computed predictions, i.e. the same predictions that are shown in the UI.
If you run the CLI after a new model has been trained, but before predictions for it had finished computing, you will get a mix of predictions from the latest model and the model before it. You can check whether predictions had finished computing in the dataset status in the UI.
Can I pass a specific model version to the CLI?
Download the CLI tool for your platform (the CLI tool is available for Linux, Mac, and Windows).
Configure the command line tool:
You will be asked to paste your API token:
The command below will download all comments and predictions in the specified source and dataset. Note that the dataset name and source name have to be prefixed by the name of the organisation they are in. If the dataset contains multiple sources, you need to issue this command for every source to download all comments in the dataset.
The CLI returns data in JSONL format (also called newline-delimited JSON), where each line is a JSON value. Many tools will be able to process JSONL files out-of-the-box. Please let us know at firstname.lastname@example.org if you have any questions.
Each line in the JSONL file will have the following format:
|Comment object in the format described here.|
|List of assigned labels, in the format described here.|
|List of assigned entities, in the format described here.|
|List of predicted labels, in the format described here.|
|List of predicted entities, in the format described here.|
Note that the
entities field may be absent completely if the
comment has neither assigned nor predicted labels or entities.
Below is an example comment with predictions downloaded from a real-life dataset.