I am using Python to program a script for IBM Watson's Personality Insights service. I am using the results as training data for a Machine Learning project.
Since the service is so limited (100 calls/month), is it possible to get multiple personality insights with only one API call?
Jeff is correct about the API limit: You are not limited to 100 api calls/month; this is just the number of free calls you get per month.
However and replying your question: Yes, it is possible to compute multiple portraits. If you are using
application/json
as Content-Type, you will notice you are including auserid
field for each content element. You can include content from different authors (userid
's), just that you cannot get the output in as JSON since this one only supports a single author. You can use the CSV API and get multiple rows, one corresponding to each author in the input.Here is sample code that may help:
import requests, json
Two notes on this code:
content
fields with your text -- more text!user1
and the last one touser2
Accept: "text/csv"
header, it will default to the JSON API and return HTTP 400: "multiple authors found". Remember to use the CSV API for multiple authors.This way you can batch some authors in a single API call. Keep in mind you need to stay under the request size limit (currently 20Mb) so you just need to be little more careful.