<p>Yes, there is. You can try Spacy. Here you go.</p>
<pre><code>import spacy 
from spacytextblob.spacytextblob import SpacyTextBlob

nlp = spacy.load('en_core_web_sm') 
spacy_text_blob = SpacyTextBlob() 
nlp.add_pipe(spacy_text_blob)

text = &quot;i'm good&quot; 
doc = nlp(text) 
print(doc._.sentiment.polarity) # 0.7

text = &quot;i'm bad&quot;  
doc = nlp(text) 
print(doc._.sentiment.polarity) # -0.6999999999999998

text = &quot;i'm neutral&quot; 
doc = nlp(text) 
print(doc._.sentiment.polarity) # 0.0

text = &quot;i'm okay&quot;  
doc = nlp(text) 
print(doc._.sentiment.polarity) # 0.5

text = &quot;i'm indifferent&quot;  
doc = nlp(text) 
print(doc._.sentiment.polarity) # 0.0
</code></pre>

CC BY-SA 4.0
2021-02-17T14:25:40.870Z
Thanks, this looks promising, I just need a few hours to check it out when im off work and then ill accept the answer!
johnny 5
CC BY-SA 4.0
2021-02-17T04:45:09.597Z
2021-02-17T04:45:09.597Z
Abhishek Verma
<p>I'm writing some financial tools,  I've found highly performant models for question and answering but when it comes to sentiment analysis I haven't found anything that good.  I'm trying to use huggingface:</p>
<pre><code>from transformers import pipeline
classifier = pipeline('sentiment-analysis')
print(classifier(&quot;i'm good&quot;))
print(classifier(&quot;i'm bad&quot;)) 
print(classifier(&quot;i'm neutral&quot;))
print(classifier(&quot;i'm okay&quot;)) 
print(classifier(&quot;i'm indifferent&quot;)) 
</code></pre>
<p>Which returns results</p>
<blockquote>
<p>[{'label': 'POSITIVE', 'score': 0.999841034412384}]</p>
</blockquote>
<blockquote>
<p>[{'label': 'NEGATIVE', 'score': 0.9997877478599548}]</p>
</blockquote>
<blockquote>
<p>[{'label': 'NEGATIVE', 'score': 0.999396026134491}]</p>
</blockquote>
<blockquote>
<p>[{'label': 'POSITIVE', 'score': 0.9998164772987366}]</p>
</blockquote>
<blockquote>
<p>[{'label': 'NEGATIVE', 'score': 0.9997762441635132}]</p>
</blockquote>
<p>The scores for all of the neutral words come up very high in a positive or negative direction,  I would of figured the model would put the score lower.</p>
<p>I've looked at some of the more <a href="https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english" rel="nofollow noreferrer">fine-tuned models</a> yet they seem to perform the same.</p>
<p>I would assume there would be some pretrained models which could handle these use cases.  If not, How can I find neutral sentiments?</p>

CC BY-SA 4.0
2021-03-10T14:49:42.950Z
@nbro, I was fine with conceptually or programmatically, but you can leave this closed since I already found an answer which met my needs.
johnny 5
<python><transformer><bert><sentiment-analysis>
Sentiment analysis does not handle neturals
johnny 5
# Sentiment analysis does not handle neturals

(Asked by: username_0 on 2021-02-17)

I'm writing some financial tools,  I've found highly performant models for question and answering but when it comes to sentiment analysis I haven't found anything that good.  I'm trying to use huggingface:
from transformers import pipeline
classifier = pipeline('sentiment-analysis')
print(classifier("i'm good"))
print(classifier("i'm bad")) 
print(classifier("i'm neutral"))
print(classifier("i'm okay")) 
print(classifier("i'm indifferent")) 

Which returns results

[{'label': 'POSITIVE', 'score': 0.999841034412384}]


[{'label': 'NEGATIVE', 'score': 0.9997877478599548}]


[{'label': 'NEGATIVE', 'score': 0.999396026134491}]


[{'label': 'POSITIVE', 'score': 0.9998164772987366}]


[{'label': 'NEGATIVE', 'score': 0.9997762441635132}]

The scores for all of the neutral words come up very high in a positive or negative direction,  I would of figured the model would put the score lower.
I've looked at some of the more fine-tuned models yet they seem to perform the same.
I would assume there would be some pretrained models which could handle these use cases.  If not, How can I find neutral sentiments?

**Tags:** python, transformer, bert, sentiment-analysis

> **Comments:**
> **username_0**: @nbro, I was fine with conceptually or programmatically, but you can leave this closed since I already found an answer which met my needs.  

---

## 1 answers

### Answer by username_1 on 2021-02-17. Score: 1 | Accepted answer

Yes, there is. You can try Spacy. Here you go.
import spacy 
from spacytextblob.spacytextblob import SpacyTextBlob

nlp = spacy.load('en_core_web_sm') 
spacy_text_blob = SpacyTextBlob() 
nlp.add_pipe(spacy_text_blob)

text = "i'm good" 
doc = nlp(text) 
print(doc._.sentiment.polarity) # 0.7

text = "i'm bad"  
doc = nlp(text) 
print(doc._.sentiment.polarity) # -0.6999999999999998

text = "i'm neutral" 
doc = nlp(text) 
print(doc._.sentiment.polarity) # 0.0

text = "i'm okay"  
doc = nlp(text) 
print(doc._.sentiment.polarity) # 0.5

text = "i'm indifferent"  
doc = nlp(text) 
print(doc._.sentiment.polarity) # 0.0

> **Comments:**
> **username_0**: Thanks, this looks promising, I just need a few hours to check it out when im off work and then ill accept the answer!  

---

