1

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?

Mithun Sreedharan
  • 49,883
  • 70
  • 181
  • 236

2 Answers2

3

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.

Simon O'Doherty
  • 9,259
  • 3
  • 26
  • 54
  • 2
    Just adding, 3000 words gives the best results, more than that is ignored, but at 600 you can already get good information. – Felipe Paixao Nov 14 '17 at 10:21
1

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"

seekahead
  • 53
  • 1
  • 7