Error with ML.NET tutorial on Sentiment Analysis

Andrew Holtzman 1 Reputation point
2021-06-12T15:49:51.873+00:00

Hi,

Recently I began using Microsoft Learn' tutorials on ML.NET to learn Machine Learning and building apps using Model Builder. I have started with the analyzing sentiment using Razor Pages tutorial (https://learn.microsoft.com/en-us/dotnet/machine-learning/tutorials/sentiment-analysis-model-builder) but keep running into an error:

String was not recognized as a valid Boolean. on var sentiment = Convert.ToBoolean(prediction.Prediction) ? "Positive" : "Negative"; in Index.cshtml.cs

This is the code snippet I took right from the tutorial article. The code on GitHub for this sample says the same, but I keep running into this error.

Why does this occur and how can I fix this?

Thank you for your help!

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,226 questions
0 comments No comments
{count} votes