79605143

Date: 2025-05-03 21:53:33
Score: 1
Natty:
Report link

You might be facing the shape error because ML.NET is strict about the input shapes (like 1x256), and your input array is only of length 10 — which doesn't match (1 x 256).

But if you're open to using ONNX directly **without ML.NET**, I just published a package that wraps BERT-based Arabic Sentiment ONNX models using only `Microsoft.ML.OnnxRuntime`.

✔ Works with raw `InferenceSession` in C#

✔ Supports tokenization via `Microsoft.ML.Tokenizers`

✔ Async and sync APIs

✔ Multi-platform (`netstandard2.0`, `net6.0`, etc.)

🔗 NuGet: https://www.nuget.org/packages/AraBertSentiment.OnnxModel

💻 Source: https://github.com/Elhady7/AraBertSentiment.OnnxModel

📁 Model Release: https://github.com/Elhady7/AraBertSentimentModel/releases

📰 Medium Article: https://medium.com/@hadysalah632/powerful-arabic-sentiment-analysis-using-onnx-and-net-9-87b6ac49d72f

Let me know if you need help migrating your pipeline away from ML.NET!

Reasons:
  • Blacklisted phrase (0.5): medium.com
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Hady Salah