Skip to content

ProfileModel

Michael edited this page Mar 21, 2017 · 1 revision
namespace WatsonSDK\Services\PersonalityInsights;

The class of parameters to be sent to PersonalityInsights service.

class ProfileModel extends ServiceModel

Used to initialize a ProfileModel model from the parameters.

 /**
     * Constructor
     *
     * @param $val string | ContentItemModel
     * @param $raw_scores boolean | NULL
     * @param $consumption_preferences boolean | NULL
     * @param $csv_headers boolean | NULL
     * @param $accept_language string | NULL
     * @param $accept string | NULL
     * @param $content_language string | NULL
     * @param $version string
     */
    function __construct($val, $raw_scores = NULL, $consumption_preferences = NULL, $csv_headers = NULL, $accept_language = NULL, $accept = NULL, $content_language = NULL, $version = self::VERSION);
Parameter Type Description
val string ContentItemModel
raw_scores boolean Indicates whether a raw score in addition to a normalized percentile is to be returned for each characteristic; raw scores are not compared with a sample population. By default (false),only normalized percentiles are returned.
consumption_preferences boolean Indicates whether consumption preferences are to be returned with the results. By default (false), they are not.
csv_headers boolean Indicates whether column labels are to be returned with a CSV response. By default (false), they are not.Applies only when the Accept header is set to text/csv.
accept_language string The desired language of the response:
ar (Arabic)
de (German)
en (English, the default)
es (Spanish)
fr (French)
it (Italian)
ja (Japanese)
ko (Korean)
pt-br (Brazilian Portuguese)
zh-cn (Simplified Chinese)
zh-tw (Traditional Chinese)
For two-character arguments, regional variants are treated as their parent language; for example, en-US is interpreted as en. You can specify any combination of languages for the request and the response.
accept string The desired content type of the response:
application/json for JSON output (the default)
text/csv for CSV output CSV output includes a fixed number of columns and optional headers.
content_language string The language of the input text for the request:
ar (Arabic)
en (English,the default)
es (Spanish)
ja (Japanese)
Regional variants are treated as their parent language; for example, en-US is interpreted as en. The effect of the Content-Language header depends on the Content-Type header:
When Content-Type is text/plain or text/html, Content-Language is the only way to specify the language.
When Content-Type is application/json, Content-Language overrides a language specified with the language parameter of a ContentItem object; content items that specify a different language are ignored. Omit this header to base the language on the specification of the content items.You can specify any combination of languages for Content-Language and Accept-Language.
version string The requested version of the response format as a date in the form YYYY-MM-DD; for example, specify 2016-10-20 for October 20, 2016. The parameter allows the service to update its response format for new versions without breaking existing clients.The date that you specify does not need to match a version of the service exactly; the service replies with the response format whose version is no later than the date you provide. If you specify a date that is earlier than the initial release of version 3, the service returns the response format for that version. If you specify a date that is in the future or otherwise later than the most recent version, the service returns the response format for the latest version.

PersonalityInsights service URL.

const BASE_URL = 'https://gateway.watsonplatform.net/personality-insights/api/v3';

Current PersonalityInsights version.

const VERSION = '2016-10-20';

Get the array of ContentItem objects that provides the input text for the request

public function getContents();

Set the array of ContentItem objects that provides the input text for the request

public function setContents($val);

Add the object to array of ContentItem that provides the input text for the request

public function addContents($val);

Get indicator of raw scores

public function getRawScores();

Set the indicator to show raw scores

public function setRawScores($val);

Get consumption preferences

public function getConsumptionPreferences();

Set consumption preferences

public function setConsumptionPreferences($val);

Get the response format if it is set to CSV format, or not

public function getCsvHeaders();

Set response as the CSV format.If set to TRUE, it only applies when the Accept header is set to text/csv

public function setCsvHeaders($val);

Get language of the input text for the request

public function getContentLanguage();

Set language of the input text for the request

public function setContentLanguage($val);

Get desired content type of the response

public function getAccept();

Set desired content type of the response

public function setAccept($val);

Get the desired language of the response

public function getAcceptLanguage();

Set the desired language of the response

public function setAcceptLanguage($val);
Clone this wiki locally