On startup the demo application reads command line parameters and loads a network to Inference engine. It also fetch data from the user-provided url to populate the "context" text. The text is then used to search named entities.
The list of models supported by the demo is in
<omz_dir>/demos/bert_named_entity_recognition_demo/python/models.lst file. This file can be used as a parameter for Model Downloader and Converter to download and, if necessary, convert models to OpenVINO Inference Engine format (*.xml + *.bin).
An example of using the Model Downloader:
An example of using the Model Converter:
Running the application with the
-h option yields the following usage message:
The application reads text from the HTML page at the given URL. The model and its parameters (inputs and outputs) are also important demo arguments. Notice that since order of inputs for the model does matter, the demo application checks that the inputs specified from the command-line match the actual network inputs.
The application outputs recognized named entities (
LOC - location,
PER - person,
ORG - organization,
MISC - miscellaneous) for each sentence in input text.
You can use the following command to try the demo (assuming the model from the Open Model Zoo, downloaded and converted with the Model Downloader executed with "--name bert*"):
Notice that when the original "context" (text from the url) do not fit the model input (128 for the Bert-Base), the demo reshapes model to maximum sentence length in the "context".
Even though the demo reports inference performance (by measuring wall-clock time for individual inference calls), it is only baseline performance, as certain tricks like batching, throughput mode can be applied. Please use the full-blown Benchmark C++ Sample for any actual performance measurements.