This project performs sentiment analysis on IMDB movie reviews, using a neural network trained in Python with Keras and deployed in C++ using ONNX Runtime for fast inference.
- Trains a simple MLP neural network on the IMDB dataset (binary classification: positive or negative review)
- Converts the trained model to ONNX format
- Loads and runs the ONNX model using C++ and ONNX Runtime
- Python (Keras, NumPy, keras2onnx, ONNX)
- C++ (ONNX Runtime C++ API)
- IMDB dataset (included in Keras)
| File | Description |
|---|---|
train_and_export.py |
Python script to train the model and export to ONNX |
main.cpp |
C++ code to load the ONNX model and run inference |
imdb_sentiment.onnx |
Exported model (generated by the Python script) |
pip install keras keras2onnx onnx numpy