Answers.Body: <p>Use TextBlob to get the text sentiment polarity and subjectivity. polarity is negative or positive sentiment and subjectivity is how factual the sentiment is.</p>
  <pre><code>my_valance=TextBlob(sentence)
  df.loc[key,'sentiment_polarity']=my_valance.sentiment.polarity
  df.loc[key,'sentiment_subjectivity']=my_valance.sentiment.subjectivity
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-08T13:09:23.337Z
Answers.Text: you want to reverse engineer the nlp equation for sentiment? why? just use the existing api TextBlog.   you could get spacy nlp and then find the sentiment portion of the open source code and reverse engineer the calcualtions.   certain words are weight negative and certain words are weighted positive and certain words are facts.  Proximity to each other have a distance and a weight
Answers.UserDisplayName: Golden Lion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-08T13:12:05.797Z
Answers.Text: The question is out of context then and should be removed.
Answers.UserDisplayName: Golden Lion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-08T13:13:04.300Z
Answers.Text: How can I apply naive Bayes classifier for three classes (Positive, Negative and Neutral) in text data?   The Sentence implies a working solution which I provided using the TextBlog api  .   naive Bayes classifier is a classifier in the pipeline.   You must use textblob to get the sentiment and polarity of the sentence then countvectorize the text into tokens for vectorization to be used by the classifier.
Answers.UserDisplayName: Golden Lion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-08T13:17:51.923Z
Answers.Text: the question about log-likelihood implies an misunderstanding of where sentiment is determined.   Sentiment is not part of the bayes classifer.  I clarified the content.
Answers.UserDisplayName: Golden Lion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-08T12:49:47.283Z
Answers.LastActivityDate: 2021-03-08T12:49:47.283Z
Answers.UserDisplayName: Golden Lion
Body: <p>I found a naive Bayes classifier for positive sentiment or a negative sentiment <a href="https://www.aclweb.org/anthology/S14-2026.pdf" rel="nofollow noreferrer">Citius: A Naive-Bayes Strategy for Sentiment Analysis on English Tweets</a>. But with most available datasets online, sentiments are classified into 3 types: positive, negative, and neutral.</p>
  <p>How does the naive Bayes formula change for such cases? Or does it remain the same, and we only consider the positive and negative to calculate the log likelihoods-likelihoods?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-15T22:35:04.930Z
Comments.Text: post a sample of the data your trying to classify.   Will it have one output label or multiple?   Are you using CountVectorizer or TfIDF to tokenize your words?
Comments.UserDisplayName: Golden Lion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-08T12:47:20.327Z
Comments.Text: naive bayes is a classifer combined in a pipeline with countvectorize in the preprocessing part of the pipeline.
Comments.UserDisplayName: Golden Lion
Tags: <sentiment-analysis><naive-bayes>
Title: How can I apply naive Bayes classifier for three classes (Positive, Negative and Neutral) in text data?
UserDisplayName: Md. Asif Iqbal Fahim
ThreadText: # How can I apply naive Bayes classifier for three classes (Positive, Negative and Neutral) in text data?
  
  (Asked by: username_0 on 2021-02-14)
  
  I found a naive Bayes classifier for positive sentiment or a negative sentiment [Citius: A Naive-Bayes Strategy for Sentiment Analysis on English Tweets](https://www.aclweb.org/anthology/S14-2026.pdf). But with most available datasets online, sentiments are classified into 3 types: positive, negative, and neutral.
  
  How does the naive Bayes formula change for such cases? Or does it remain the same, and we only consider the positive and negative to calculate the log likelihoods-likelihoods?
  
  **Tags:** sentiment-analysis, naive-bayes
  
  > **Comments:**
  > **username_1**: post a sample of the data your trying to classify.   Will it have one output label or multiple?   Are you using CountVectorizer or TfIDF to tokenize your words?  
  > **username_1**: naive bayes is a classifer combined in a pipeline with countvectorize in the preprocessing part of the pipeline.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-03-08. Score: -1
  
  Use TextBlob to get the text sentiment polarity and subjectivity. polarity is negative or positive sentiment and subjectivity is how factual the sentiment is.
  
  ```
  my_valance=TextBlob(sentence)
  df.loc[key,'sentiment_polarity']=my_valance.sentiment.polarity
  df.loc[key,'sentiment_subjectivity']=my_valance.sentiment.subjectivity
  
  ```
  
  > **Comments:**
  > **username_1**: you want to reverse engineer the nlp equation for sentiment? why? just use the existing api TextBlog.   you could get spacy nlp and then find the sentiment portion of the open source code and reverse engineer the calcualtions.   certain words are weight negative and certain words are weighted positive and certain words are facts.  Proximity to each other have a distance and a weight  
  > **username_1**: The question is out of context then and should be removed.  
  > **username_1**: How can I apply naive Bayes classifier for three classes (Positive, Negative and Neutral) in text data?   The Sentence implies a working solution which I provided using the TextBlog api  .   naive Bayes classifier is a classifier in the pipeline.   You must use textblob to get the sentiment and polarity of the sentence then countvectorize the text into tokens for vectorization to be used by the classifier.  
  > **username_1**: the question about log-likelihood implies an misunderstanding of where sentiment is determined.   Sentiment is not part of the bayes classifer.  I clarified the content.  
  
  ---
  
  