SlideShare a Scribd company logo
www.techconnect.io
Build a Sentiment Model using
ML.Net
Eng Soon Cheah
Microsoft MVP
@cheahengsoon
Prerequisites
• Visual Studio 2017/ Visual Studio 2019
• ML.NET Model Builder
• Sentiment140 Dataset
Create the Project
As soon as the installation has completed open Visual Studio and create a new .NET Core console app.
Right-click on the project in Solution Explorer and select Add > Machine Learning. This opens the ML.NET Model Builder in a new
window in Visual Studio. Model Builder will help us through the process of building a machine learning model.
Building your model
To generate your model, you need to select a machine learning scenario. Model Builder offers several templates. Now we are
going to select the Sentiment Analysis scenario.
• In Model Builder, you can add data from a local file or connect to a SQL Server
database. In this case, you will add the dataset file you downloaded in the
Prerequisites step.
• Select File as the input data source in the drop-down, and in Select a file find and
select the dataset file. In my case is the mini dataset I created from the
Sentiment140 dataset.
• Under Column to predict (Label), select “0”. Since the Dataset has no headers it
takes the first row. You can add headers to avoid misunderstandings. The Label is
what you are predicting, which in this case is the Sentiment found in the first
column of the dataset. The rest of the columns are Features, which are attributes
that help predict the Label.
• If you are using the mini dataset 0 is for negative 1 is for positive. If you are using
the original dataset 0 is negative 2 is neutral and 4 is positive, so make a note of
this.
Build a Sentiment Model using ML.Net
Train your Model
Select Start Training to start the training process.
You can keep track of the progress of model training in the Progress section.
• Status – This shows you the status of the model training process; this will tell
you how much time is left in the training process and will also tell you when
the training process has completed.
• Best accuracy – This shows you the accuracy of the best model that Model
Builder has found so far. Higher accuracy means the model predicted more
correctly on test data.
• Best algorithm – This shows you which algorithm performed the best so far
during Model Builder’s exploration.
• Last algorithm – This shows you the last algorithm that was explored by
Model Builder.
After model training finishes, go to the Evaluate step. The Evaluate step shows
you various outputs, including how many models were explored and the ML
task (in this case binary classification). Model Builder also displays the top 5
models explored and displays several evaluation metrics for each of those top 5
models, including AUC, AUPRC, and F1-score. You can find more informatio on
what those are here.
Build a Sentiment Model using ML.Net
Run the project
• After evaluating your model, move on to the Code step. In the Code step in
Model Builder, select Add Projects.
• Model Builder adds both the machine learning model and the projects for
training and consuming the model to your solution. In the Solution Explorer,
you should see the code files that were generated by Model Builder.
Build a Sentiment Model using ML.Net
References
• ML.NET Model Builder
https://dotnet.microsoft.com/apps/machinelearning-ai/ml-dotnet/model-
builder
www.techconnect.io

More Related Content

PPTX
Machine Learning With ML.NET
PPTX
Introduction to ML.NET
PPTX
Machine Learning for .NET Developers - ADC21
PDF
201906 02 Introduction to AutoML with ML.NET 1.0
PPTX
Getting Started with Azure AutoML
PDF
201906 01 Introduction to ML.NET 1.0
PDF
The Barclays Data Science Hackathon: Building Retail Recommender Systems base...
PDF
Robust and declarative machine learning pipelines for predictive buying at Ba...
Machine Learning With ML.NET
Introduction to ML.NET
Machine Learning for .NET Developers - ADC21
201906 02 Introduction to AutoML with ML.NET 1.0
Getting Started with Azure AutoML
201906 01 Introduction to ML.NET 1.0
The Barclays Data Science Hackathon: Building Retail Recommender Systems base...
Robust and declarative machine learning pipelines for predictive buying at Ba...

What's hot (20)

PPTX
Model Drift Monitoring using Tensorflow Model Analysis
PPTX
Personalized Job Recommendation System at LinkedIn: Practical Challenges and ...
PPTX
2021 02 23 MVP Fusion Getting Started with Machine Learning.Net and AutoML
PDF
The Power of Auto ML and How Does it Work
PDF
Machine Learning system architecture – Microsoft Translator, a Case Study : ...
PPTX
Machine learning
PDF
Demystifying Data Science
PPTX
Machine Learning in Production with Dato Predictive Services
PPTX
Lessons Learned from Building Machine Learning Software at Netflix
PDF
Architecting for Data Science
PDF
MLSEV Virtual. Applying Topic Modelling to improve Operations
PDF
AI driven classification framework for advanced Test Automation
PPTX
Do My MATLAB Homework Research Assistance
PPTX
MATLAB Training Online
PDF
Automatic machine learning (AutoML) 101
PPTX
Thesis Based on MATLAB Research Ideas
PPTX
Do My MATLAB Assignment Research Guidance
PPTX
Computer vision-must-nit-silchar-ml-hackathon-2019
PDF
Strata 2016 - Lessons Learned from building real-life Machine Learning Systems
PDF
AI-Assisted Feature Selection for Big Data Modeling
Model Drift Monitoring using Tensorflow Model Analysis
Personalized Job Recommendation System at LinkedIn: Practical Challenges and ...
2021 02 23 MVP Fusion Getting Started with Machine Learning.Net and AutoML
The Power of Auto ML and How Does it Work
Machine Learning system architecture – Microsoft Translator, a Case Study : ...
Machine learning
Demystifying Data Science
Machine Learning in Production with Dato Predictive Services
Lessons Learned from Building Machine Learning Software at Netflix
Architecting for Data Science
MLSEV Virtual. Applying Topic Modelling to improve Operations
AI driven classification framework for advanced Test Automation
Do My MATLAB Homework Research Assistance
MATLAB Training Online
Automatic machine learning (AutoML) 101
Thesis Based on MATLAB Research Ideas
Do My MATLAB Assignment Research Guidance
Computer vision-must-nit-silchar-ml-hackathon-2019
Strata 2016 - Lessons Learned from building real-life Machine Learning Systems
AI-Assisted Feature Selection for Big Data Modeling
Ad

Similar to Build a Sentiment Model using ML.Net (20)

PDF
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
PDF
AI Associate Series S6: The GenAI Experience in UiPath Document Understanding
PPTX
Azure machine learning
PPTX
Iris Multi-Class Classifier with Azure ML
PPTX
Azure Machine Learning Dotnet Campus 2015
PPTX
Net campus2015 antimomusone
PPTX
PREDICT THE FUTURE , MACHINE LEARNING & BIG DATA
PPTX
Building an AI and ML Model Using KNIME and Python.pptx
PDF
Ml ops intro session
PPTX
Teachableee Machine for great learners in unique way
PPTX
Software Design principales
PPTX
BTech Final Project (1).pptx
PPTX
Software Testing interview - Q&A and tips
PPTX
Software development life cycle copy
PDF
The 7 Key Steps To Build Your Machine Learning Model
PPT
Testing Frameworks
DOCX
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
PDF
Agile Estimating and Planning
PDF
Data manipulation
PDF
Microsoft az-204 download free demo at dumps cafe
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
AI Associate Series S6: The GenAI Experience in UiPath Document Understanding
Azure machine learning
Iris Multi-Class Classifier with Azure ML
Azure Machine Learning Dotnet Campus 2015
Net campus2015 antimomusone
PREDICT THE FUTURE , MACHINE LEARNING & BIG DATA
Building an AI and ML Model Using KNIME and Python.pptx
Ml ops intro session
Teachableee Machine for great learners in unique way
Software Design principales
BTech Final Project (1).pptx
Software Testing interview - Q&A and tips
Software development life cycle copy
The 7 Key Steps To Build Your Machine Learning Model
Testing Frameworks
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docx
Agile Estimating and Planning
Data manipulation
Microsoft az-204 download free demo at dumps cafe
Ad

More from Cheah Eng Soon (20)

PPTX
Microsoft Defender for Endpoint
PPTX
Azure Active Directory - Secure and Govern
PPTX
Microsoft Zero Trust
PPTX
MEM for OnPrem Environments
PPTX
Microsoft Threat Protection Automated Incident Response
PDF
Azure Penetration Testing
PDF
Azure Penetration Testing
PPTX
Microsoft Threat Protection Automated Incident Response Demo
PPTX
Microsoft Secure Score Demo
PPTX
Microsoft Cloud App Security Demo
PPTX
M365 Attack Simulation Demo
PPTX
Cloud Security Demo
PPTX
Azure Active Directory - External Identities Demo
PPTX
Azure WAF
PPTX
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
PPTX
Microsoft Azure的20大常见安全漏洞与配置错误
PDF
20 common security vulnerabilities and misconfiguration in Azure
PPTX
Integrate Microsoft Graph with Azure Bot Services
PPTX
Azure Sentinel with Office 365
PPTX
3 Steps Integrate Microsoft Graph with Azure Bot Services
Microsoft Defender for Endpoint
Azure Active Directory - Secure and Govern
Microsoft Zero Trust
MEM for OnPrem Environments
Microsoft Threat Protection Automated Incident Response
Azure Penetration Testing
Azure Penetration Testing
Microsoft Threat Protection Automated Incident Response Demo
Microsoft Secure Score Demo
Microsoft Cloud App Security Demo
M365 Attack Simulation Demo
Cloud Security Demo
Azure Active Directory - External Identities Demo
Azure WAF
Azure Weekend 2020 Build Malaysia Bus Uncle Chatbot
Microsoft Azure的20大常见安全漏洞与配置错误
20 common security vulnerabilities and misconfiguration in Azure
Integrate Microsoft Graph with Azure Bot Services
Azure Sentinel with Office 365
3 Steps Integrate Microsoft Graph with Azure Bot Services

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Spectroscopy.pptx food analysis technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MYSQL Presentation for SQL database connectivity
Reach Out and Touch Someone: Haptics and Empathic Computing
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Weekly Chronicles - August'25 Week I
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Diabetes mellitus diagnosis method based random forest with bat algorithm
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
Spectroscopy.pptx food analysis technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Build a Sentiment Model using ML.Net

  • 1. www.techconnect.io Build a Sentiment Model using ML.Net Eng Soon Cheah Microsoft MVP @cheahengsoon
  • 2. Prerequisites • Visual Studio 2017/ Visual Studio 2019 • ML.NET Model Builder • Sentiment140 Dataset
  • 4. As soon as the installation has completed open Visual Studio and create a new .NET Core console app.
  • 5. Right-click on the project in Solution Explorer and select Add > Machine Learning. This opens the ML.NET Model Builder in a new window in Visual Studio. Model Builder will help us through the process of building a machine learning model.
  • 7. To generate your model, you need to select a machine learning scenario. Model Builder offers several templates. Now we are going to select the Sentiment Analysis scenario.
  • 8. • In Model Builder, you can add data from a local file or connect to a SQL Server database. In this case, you will add the dataset file you downloaded in the Prerequisites step. • Select File as the input data source in the drop-down, and in Select a file find and select the dataset file. In my case is the mini dataset I created from the Sentiment140 dataset. • Under Column to predict (Label), select “0”. Since the Dataset has no headers it takes the first row. You can add headers to avoid misunderstandings. The Label is what you are predicting, which in this case is the Sentiment found in the first column of the dataset. The rest of the columns are Features, which are attributes that help predict the Label. • If you are using the mini dataset 0 is for negative 1 is for positive. If you are using the original dataset 0 is negative 2 is neutral and 4 is positive, so make a note of this.
  • 11. Select Start Training to start the training process.
  • 12. You can keep track of the progress of model training in the Progress section. • Status – This shows you the status of the model training process; this will tell you how much time is left in the training process and will also tell you when the training process has completed. • Best accuracy – This shows you the accuracy of the best model that Model Builder has found so far. Higher accuracy means the model predicted more correctly on test data. • Best algorithm – This shows you which algorithm performed the best so far during Model Builder’s exploration. • Last algorithm – This shows you the last algorithm that was explored by Model Builder.
  • 13. After model training finishes, go to the Evaluate step. The Evaluate step shows you various outputs, including how many models were explored and the ML task (in this case binary classification). Model Builder also displays the top 5 models explored and displays several evaluation metrics for each of those top 5 models, including AUC, AUPRC, and F1-score. You can find more informatio on what those are here.
  • 16. • After evaluating your model, move on to the Code step. In the Code step in Model Builder, select Add Projects. • Model Builder adds both the machine learning model and the projects for training and consuming the model to your solution. In the Solution Explorer, you should see the code files that were generated by Model Builder.
  • 18. References • ML.NET Model Builder https://dotnet.microsoft.com/apps/machinelearning-ai/ml-dotnet/model- builder