dotnet / dotnet/machinelearning-modelbuilder
ML.NET Tutorial - Sentiment Prediction Sample Code
- Dominant language
- Dockerfile
- Stars
- 285
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I have tried your tutorial to developed my first AI Model using your tutorial with link below, it is an AI sample for sentiment Analysis.
All the Steps worked fine and i am able to create a model successfully but when i tried consuming this model as per instruction it ran but its giving response in opposite. like my below code it should give me positve sentiment but it is output as Negative that is wrong.
Tutorial Link:
https://dotnet.microsoft.com/en-us/learn/ml-dotnet/get-started-tutorial/intro
The sample code for Reference:
`var sampleData = new SentimentMLModel.ModelInput()
{
Col0 = "This restaurant was wonderful."
};
//Load model and predict output
var result = SentimentMLModel.Predict(sampleData);
// If Prediction is 1, sentiment is "Positive"; otherwise, sentiment is "Negative"
var sentiment = result.PredictedLabel == 1 ? "Positive" : "Negative";
Console.WriteLine($"Text: {sampleData.Col0}\nSentiment: {sentiment}");`
The Output:
"Sentiment: Negative"

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.