0

I have 2 very simple sentences which produce very different sentiment values from the IBM Watson NLU engine. So I am at a loss how to configure the APIs to handle each sentence consistently.

  "text": "WidgetX has been recently created. It is terrible.",
  "features": {
    "sentiment": {},
    "entities": {
      "sentiment": true
    },
    "keywords": {
      "sentiment": true
    }
  }

Produces a neutral sentiment:

  "keywords": [
    {
      "text": "WidgetX",
      "sentiment": {
        "score": 0,
        "label": "neutral"
      },
      "relevance": 0.5,
      "count": 1
    }
  ],
  "entities": [
    {
      "type": "Organization",
      "text": "WidgetX",
      "sentiment": {
        "score": 0,
        "label": "neutral"
      },
      "relevance": 0.978348,
      "count": 1,
      "confidence": 0.562355
    }
  ]

Whereas changing the text to below produces the correct very negative sentiment:

  "text": "WidgetX has been recently created, and it is terrible.",

  "keywords": [
    {
      "text": "WidgetX",
      "sentiment": {
        "score": -0.964476,
        "label": "negative"
      },
      "relevance": 0.5,
      "count": 1
    }
  ],
  "entities": [
    {
      "type": "Organization",
      "text": "WidgetX",
      "sentiment": {
        "score": -0.964476,
        "label": "negative"
      },
      "relevance": 0.978348,
      "count": 1,
      "confidence": 0.319847
    }
  ]
ImTalkingCode
  • 353
  • 1
  • 3
  • 14

1 Answers1

1

This is interesting. The phrase

WidgetX has been recently created, and it is terrible.

is a single sentence. By context it can refer to a number of things the nominative noun WidgetX or the adverb recently or the verb created. So that one or more of the following is being stated.

  • WidgetX is terrible
  • That its creation was recent is terrible
  • That it has been created is terrible

In all cases its a negative statement.

The phrase

WidgetX has been recently created. It is terrible.

comprises of two sentences. The first sentence just states that WidgetX has been created, there is no emotion. There is no context in the second statement, just the pronoun it, where It might be related to the first sentence or it might not.

chughts
  • 4,210
  • 2
  • 14
  • 27
  • The engine should be more advanced than that. It should recognise that the subject of the 2nd sentence is a pronoun. The definition of 'it': "used to refer to a thing previously mentioned or easily identified". It should default to the subject of the previous sentence. – ImTalkingCode Apr 09 '22 at 10:39
  • I think that it does allow it, but you can't restrict it to a single possible meaning, you should allow it to have all of it's grammatical meanings, and there are lots. - https://dictionary.cambridge.org/dictionary/english/it – chughts Apr 11 '22 at 06:30
  • eg. "It as an ‘empty’ or ‘dummy’ subject and object We can use it as an ‘empty’ subject or as an ‘empty’ object. It is ‘empty’ because it doesn’t refer to anything in particular:" – chughts Apr 11 '22 at 06:31