Simple client to database client migration

The simple client in the SDK is deprecated, and all its functionality has been merged into the more full-featured database client.

This guide shows some example commands in the simple client and how one would re-implement them in the database client.

For more options for the database client, see the emtellipro-db-client --help message and Database Client Options.

Prerequisites

Set up the environment variables used in this guide for access to the NLP API server. You will need to set the following environment variables for the NLP API server and your access and secret keys. If you do not have access to the appropriate values for these variables please contact us.

$export EMTELLIPRO_SERVER=''
$export EMTELLIPRO_ACCESS_KEY=''
$export EMTELLIPRO_SHARED_SECRET=''

Getting the logged in user

Simple client:

$emtellipro-client \
> get-user \
> --access-key $EMTELLIPRO_ACCESS_KEY \
> --secret-key $EMTELLIPRO_SHARED_SECRET \
> --server $EMTELLIPRO_SERVER

Database client:

$emtellipro-db-client \
> get-user
$ --access-key $EMTELLIPRO_ACCESS_KEY \
> --shared-secret $EMTELLIPRO_SHARED_SECRET \
> --server $EMTELLIPRO_SERVER

Processing documents

Simple client:

$emtellipro-client \
> submit \
> --access-key $EMTELLIPRO_ACCESS_KEY \
> --secret-key $EMTELLIPRO_SHARED_SECRET \
> --server $EMTELLIPRO_SERVER \
> --output path/to/result.jsonl \
> --category Radiology \
> --features FEATURE1,FEATURE2 \
> --state-file path/to/state.db \
> --recursive \
> FILEPATHS...

Database client:

$emtellipro-db-client \
> --output raw+jsonl://path/to/result.jsonl \
> process \
> --access-key $EMTELLIPRO_ACCESS_KEY \
> --shared-secret $EMTELLIPRO_SHARED_SECRET \
> --server $EMTELLIPRO_SERVER \
> --category Radiology \
> --features FEATURE1,FEATURE2 \
> --state path/to/state.db \
> --recursive \
> FILEPATHS...

Continuing processing

The simple client had a continue command which allowed continuing processing in case of a crash. The database client now supports that same functionality by the --state parameter in the process; simply re-run the same command with the same state file and processing will automatically continue.

Cancelling a task

Simple client:

$emtellipro-client \
> cancel \
> --access-key $EMTELLIPRO_ACCESS_KEY \
> --shared-secret $EMTELLIPRO_SHARED_SECRET \
> --server $EMTELLIPRO_SERVER \
> --task-id TASK_ID

Database client:

$emtellipro-db-client \
> cancel \
> --access-key $EMTELLIPRO_ACCESS_KEY \
> --shared-secret $EMTELLIPRO_SHARED_SECRET \
> --server $EMTELLIPRO_SERVER \
> --task TASK_ID