hi Aravind
in case it helps, the problem could be, you need to create a suitable Pre and Post processor in Java,
to map the input and output to/from the ONNX.
https://github.com/mendix/mlkit-example-app/tree/main/javasource
The BERT model is text based, so perhaps looking at the pre/post processors for that model, could be of use:
https://github.com/mendix/mlkit-example-app/tree/main/javasource/bert/actions
Sean