# Sentiment of single words/phrases

**URL:** <https://support.prodi.gy/t/sentiment-of-single-words-phrases/1377>\
**Category:** Uncategorized\
**Tags:** usage, textcat, spacy, solved\
**Created:** [April 8, 2019, 1:29pm UTC](https://support.prodi.gy/t/sentiment-of-single-words-phrases/1377 "2019-04-08T13:29:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![katarkor](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/katarkor/32/641_2.png) [@katarkor](https://support.prodi.gy/u/katarkor)\
**Post date:** [April 8, 2019, 1:29pm UTC](https://support.prodi.gy/t/sentiment-of-single-words-phrases/1377/1 "2019-04-08T13:29:44Z")

</div>

Hi,  
I trained a sentiment analysis model on a bunch of movie reviews using a slightly modified version of:

> <https://github.com/explosion/spaCy/blob/master/examples/training/train_textcat.py>

  
but I noticed that the model didn’t work well on short sentences, which is no wonder, since the training data was full-length articles. I was wondering if I could somehow feed Prodigy a list of negative and positive words and retrain the model so that it takes those words into account and, hopefully, works better on shorter sentences. Is this a bad or good idea to use e.g. `textcat` or `mark` recipes and feed them words/phrases that are either positive or negative on their own (without context) and label them accordingly? And how does spaCy/Prodigy deal with negation?  
Another thing I’m wondering about is whether there is any significant difference between adding word vectors via spaCy’s `init-model` and `train` (using `--vectors`) vs training the basic model without vectors and using Prodigy’s `terms.train-vectors`?

---

<div class="post-metadata">

**Author:** ![honnibal](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/honnibal/32/35_2.png) [@honnibal](https://support.prodi.gy/u/honnibal)\
**Post date:** [April 15, 2019, 8:39am UTC](https://support.prodi.gy/t/sentiment-of-single-words-phrases/1377/2 "2019-04-15T08:39:03Z")

</div>

> Is this a bad or good idea to use e.g. `textcat` or `mark` recipes and feed them words/phrases that are either positive or negative on their own (without context) and label them accordingly?

I think it could work, but you could also just take text you've labelled as positive or negative and split it into sentences, and train on those sentences.

The current model should actually do fairly okay at normalising for length. One of the things that makes short text hard is that there's just less evidence in the sample you're classifying. So, the problem might not only be the training bias. Short texts are also just harder fundamentally.

> [@katarkor](#):
>
> And how does spaCy/Prodigy deal with negation?

The text classification uses a convolutional neural network, so it's able to see some context around the words. This allows negation clues to be picked up during training.

> [@katarkor](#):
>
> Another thing I’m wondering about is whether there is any significant difference between adding word vectors via spaCy’s `init-model` and `train` (using `--vectors` ) vs training the basic model without vectors and using Prodigy’s `terms.train-vectors` ?

There shouldn't be a significant difference there, no.

---

<div class="post-metadata">

**Author:** ![katarkor](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/katarkor/32/641_2.png) [@katarkor](https://support.prodi.gy/u/katarkor)\
**Post date:** [May 2, 2019, 12:34pm UTC](https://support.prodi.gy/t/sentiment-of-single-words-phrases/1377/3 "2019-05-02T12:34:36Z")

</div>

Allright, thanks for your answer 🙂
