IBM Watson NLU: extract entities sentiment

214 Views Asked by At

I'm working with Watson NLU (with a custom model) and my problem is that when I ask for the entities sentiment (as explained in the documentation) the POST doesn't return it, just the entity type. I pass this features:

    "features": {   
            "sentiment": {}, 
            "relations":{
                "model":"XXXXXXXXXXXXXXXXX"
            },
            "entities":{
                 "model":"XXXXXXXXXXXXXXXXX",
                 "sentiment":"1" ----I've tried with "true" too---
            }
     }

¿Am I doing anything wrong? Thanks!

1

There are 1 best solutions below

1
On

In order to enable targeted sentiment for entities, you need to set "sentiment": true. Note that you don't need quotes around true, it is a boolean value not a string. See below

"features": { "sentiment": {}, "relations":{ "model":"XXXXXXXXXXXXXXXXX" }, "entities":{ "model":"XXXXXXXXXXXXXXXXX", "sentiment": true } }