Watson Personality insight minimum number of words required Issue

603 views Asked by At

I'm following this Personality insight starter but always get below error message for API call

{"help":"http:\/\/www.ibm.com\/smarterplanet\/us\/en\/ibmwatson\/developercloud\/doc\/personality-insights\/#overviewInput","code":400,"sub_code":"S00014","error":"The number of words 2 is less than the minimum number of words required for analysis: 100"}

Here is the curl request

curl -X POST --user xxxx:yyyy --header "Content-Type: text/plain;charset=utf-8" --data-binary "profile.txt" "https://gateway.watsonplatform.net/personality-insights/api/v3/profile?version=2017-11-14"

Am I missing something here?

2

There are 2 answers

1
Simon O'Doherty On BEST ANSWER

Personality insights requires a minimum of 100 words to work. But you won’t get a true insight until around 1,200 words (IIRC).

It’s telling you that you only supplied two words. If this isn’t the case, ensure that you JSON data is correctly escaped.

0
seekahead On

The question is old but, no one seems to have added the answer. Just in case, someone also encountered the same error, the issue is missing "@" while specifying the file from which the content has to be read. From "man curl" on ubuntu 16.04
``` --data-binary (HTTP) This posts data exactly as specified with no extra processing whatsoever.

          If  you  start the data with the letter @, the rest should be a filename.  Data is posted in a similar manner as --data-ascii
          does, except that newlines and carriage returns are preserved and conversions are never done.

```

So, the request should have been curl -X POST --user xxxx:yyyy --header "Content-Type: text/plain;charset=utf-8" --data-binary "@profile.txt" "https://gateway.watsonplatform.net/personality-insights/api/v3/profile?version=2017-11-14"