dotnet / machinelearning

ML.NET is an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
8.94k stars 1.86k forks source link

Using Roberta-base fine-tuned for boolq exported to ONNX in ML.NET #6803

Open saibaldas opened 11 months ago

saibaldas commented 11 months ago

Roberta-base fine-tuned for the boolq dataset uses the tokenizer encode_plus to encode both the question and context. When exported to ONNX , the inputs are

name: input_ids tensor: int64[batch_size,sequence_length]

name: attention_mask tensor: int64[batch_size,sequence_length]

Please suggest the steps to run the ONNX for inference in ML.NET . The BertTokenizer can't be used as the tokenizer is BPE Tried to use the https://gist.github.com/luisquintanilla/bc91de8668cfa7c3755b20329fadd027 without much success