You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How TorchSharp & Onnx can address the pain points of the ~900 ML.NET Apr2021 survey responses? #5874
It is clear that NLP is high on priority
This means **more deep learning NLP use cases ** e.g. using ML.NET to load pretrained Hugging Face transformer models using OnnxRuntime
The porting process is now more feasible due to [the recent renaming effort of TorchSharp] (dotnet/TorchSharp#308 (comment)) which make TorchSharp codes MORE resemble PyTorch
The users of the April survey requested NLP use case.
There are more image related examples involving ML.NET than NLP. Image use case, unlike NLP, which often does not involve variable dimension inputs and outputs.
I suggest the document provides, in addition to image, NLP examples from e.g. Onnx Zoo model e.g. GPT-2 => which will show HOW TO DEAL with VARIABLE dimension and the need to use ShapeDictionary.
shapeDictionary, which is particularly useful for working with variable dimension inputs and outputs.
Activity
michaelgsharp commentedon Jul 22, 2021
@briacht can you take a look at this?
briacht commentedon Jul 23, 2021
Yes! I had a conversation with @GeorgeS2019 about deep learning in .NET.
As part of our deep learning plan, we will enable NLP scenarios.
I believe these suggestions will start at the TorchSharp level.
GeorgeS2019 commentedon Jul 30, 2021
@michaelgsharp @briacht
Just identified an error in the c# example for the method 2 of OnnxCatalog.ApplyOnnxModel
The method 2 involves shapeDictionary, which is particularly useful for working with variable dimension inputs and outputs.
All examples provided by OnnxCatalog.ApplyOnnxMode use Image Classification through squeezenet onnx from Onnx zoo models
The users of the April survey requested NLP use case.
There are more image related examples involving ML.NET than NLP. Image use case, unlike NLP, which often does not involve variable dimension inputs and outputs.
I suggest the document provides, in addition to image, NLP examples from e.g. Onnx Zoo model e.g. GPT-2 => which will show HOW TO DEAL with VARIABLE dimension and the need to use ShapeDictionary.
This statement was introduced to the documentation through this PR to address the need for handling of variable axes of ONNX-models often found in NLP use case
We need expand the documentation to elaborate how to handle variable axes (e.g. using ShapeDictionary) especially in NLP use case
briacht commentedon Jul 30, 2021
Thanks for the suggestion @GeorgeS2019!
@luisquintanilla can we add an issue to the docs repo for this?
GeorgeS2019 commentedon Aug 17, 2021
@briacht
As correctly pointed out by @antoniovs1029
This missing feature has been raised by @yaeldekel here Add "Reshape Transform"
=> I request to look into this "tensor reshaping" and the variable dimension discussed above. Perhaps both are related.
Here are NLP cases applying OnnxCatalog.ApplyOnnxModel onnx models
Perhaps by implementing the "Reshape Transform", this could address challenges when working with NLP with ML.NET?
matouskozak commentedon Sep 1, 2026
Triage: Closing as outdated.