0% found this document useful (0 votes)
17 views

Sentiment Analysis

Uploaded by

svea2166
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Sentiment Analysis

Uploaded by

svea2166
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Sentiment Analysis

Using Logistic Regression

Compiled by:
Dr. Amit Kumar Trivedi
Department of Computer Science and Engineering
TIET, Patiala
Source of slide: DeepLearning.AI

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Supervised ML

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Vocabulary and Feature Extraction

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Feature Extraction with Frequencies

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Putting it all together

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Logistic Regression: Overview

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Logistic Regression: Overview

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Logistic Regression: Training

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Logistic Regression: Testing

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Sentiment Analysis
Using Naïve Bayes

Compiled by:
Dr. Amit Kumar Trivedi
Department of Computer Science and Engineering
TIET, Patiala
Source of slide: DeepLearning.AI

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Probability and Bayes’ Rule

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Probability and Bayes’ Rule

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Probability and Bayes’ Rule

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Naïve Bayes Introduction

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Naïve Bayes Introduction

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Laplacian Smoothing

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Log Likelihood

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Log Likelihood

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Log Likelihood

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Log Likelihood

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Training naïve Bayes
1. Get or annotate a dataset with
positive and negative tweets
2. Pre-process the tweets to get
[w1, w2, w3, …]
3. Compute freq(w, class)
4. Get P(w|pos), P(w|neg)
5. Get λ(w)
6. Compute logprior=log(P(pos)/P(neg))

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI
Applications of Naïve Bayes

Compiled by: Dr. Amit Kumar Trivedi, CSED, TIET, Patiala, Source: DeepLearning.AI

You might also like