This example loads a neural network for answering a query about a given context paragraph. It is converted from ONNX Model Zoo and confirm its accuracy and speed based on SQuAD v1.1.
onnx: 1.12.0
onnxruntime: 1.13.1
Validated framework versions can be found in main readme.
Download model from ONNX Model Zoo.
wget https://github.com/onnx/models/raw/main/text/machine_comprehension/bidirectional_attention_flow/model/bidaf-11.onnx
Download SQuAD dataset from SQuAD dataset link.
Quantize model with dynamic quantization:
bash run_tuning.sh --input_model=path/to/model \ # model path as *.onnx
--dataset_location=path/to/squad_v1/dev-v1.1.json
--output_model=path/to/model_tune
bash run_benchmark.sh --input_model=path/to/model \ # model path as *.onnx
--dataset_location=path/to/squad_v1/dev-v1.1.json
--mode=performance # or accuracy