You can modify the dict.json file with your own word-to-index mapping and replace the model.onnx file with your trained ONNX model. And you need to change the input vector shape according to your model input size.
Folder Structure
src: Contains the Rust source code files.
dict.json: JSON file containing the word-to-index mapping.
model.onnx: ONNX model file for text classification.
ONNX Model Inference with Rust
This Rust program demonstrates how to perform inference using an ONNX model for text classification.
Prerequisites
Make sure you have Rust installed on your machine. You can install it by following the instructions on the official Rust website.
Getting Started
Clone the repository:
Change into the project directory:
Build and run the program:
Usage
You can modify the
dict.json
file with your own word-to-index mapping and replace themodel.onnx
file with your trained ONNX model. And you need to change the input vector shape according to your model input size.Folder Structure
src
: Contains the Rust source code files.dict.json
: JSON file containing the word-to-index mapping.model.onnx
: ONNX model file for text classification.Acknowledgments
License
This project is licensed under the MIT License - see the LICENSE file for details.