public class PersonalityInsights
extends com.ibm.cloud.sdk.core.service.BaseService
The service can automatically infer, from potentially noisy social media, portraits of individuals that reflect their personality characteristics. The service can infer consumption preferences based on the results of its analysis and, for JSON content that is timestamped, can report temporal behavior. * For information about the meaning of the models that the service uses to describe personality characteristics, see [Personality models](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-models#models). * For information about the meaning of the consumption preferences, see [Consumption preferences](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-preferences#preferences).
**Note:** Request logging is disabled for the Personality Insights service. Regardless of whether you set the `X-Watson-Learning-Opt-Out` request header, the service does not log or retain data from requests and responses.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_SERVICE_NAME |
static java.lang.String |
DEFAULT_SERVICE_URL |
| Constructor and Description |
|---|
PersonalityInsights(java.lang.String version)
Constructs an instance of the `PersonalityInsights` client.
|
PersonalityInsights(java.lang.String version,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `PersonalityInsights` client.
|
PersonalityInsights(java.lang.String version,
java.lang.String serviceName)
Constructs an instance of the `PersonalityInsights` client.
|
PersonalityInsights(java.lang.String version,
java.lang.String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `PersonalityInsights` client.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getVersion()
Gets the version.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Profile> |
profile(ProfileOptions profileOptions)
Get profile.
|
com.ibm.cloud.sdk.core.http.ServiceCall<java.io.InputStream> |
profileAsCsv(ProfileOptions profileOptions)
Get profile as csv.
|
void |
setVersion(java.lang.String version)
Sets the version.
|
configureClient, configureHttpClient, configureService, createServiceCall, enableGzipCompression, getAuthenticator, getClient, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, processServiceCall, setAuthentication, setClient, setDefaultHeaders, setDefaultHeaders, setEndPoint, setServiceUrl, toStringpublic static final java.lang.String DEFAULT_SERVICE_NAME
public static final java.lang.String DEFAULT_SERVICE_URL
public PersonalityInsights(java.lang.String version)
version - Release date of the version of the API you want to use. Specify dates in
YYYY-MM-DD format. The current version is `2017-10-13`.public PersonalityInsights(java.lang.String version,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
version - Release date of the version of the API you want to use. Specify dates in
YYYY-MM-DD format. The current version is `2017-10-13`.authenticator - the Authenticator instance to be configured for this clientpublic PersonalityInsights(java.lang.String version,
java.lang.String serviceName)
version - Release date of the version of the API you want to use. Specify dates in
YYYY-MM-DD format. The current version is `2017-10-13`.serviceName - the service name to be used when configuring the client instancepublic PersonalityInsights(java.lang.String version,
java.lang.String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
version - Release date of the version of the API you want to use. Specify dates in
YYYY-MM-DD format. The current version is `2017-10-13`.serviceName - the service name to be used when configuring the client instanceauthenticator - the Authenticator instance to be configured for this clientpublic java.lang.String getVersion()
Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is `2017-10-13`.
public void setVersion(java.lang.String version)
version - the new versionpublic com.ibm.cloud.sdk.core.http.ServiceCall<Profile> profile(ProfileOptions profileOptions)
Generates a personality profile for the author of the input text. The service accepts a maximum of 20 MB of input content, but it requires much less text to produce an accurate profile. The service can analyze text in Arabic, English, Japanese, Korean, or Spanish. It can return its results in a variety of languages.
**See also:** * [Requesting a profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#input) * [Providing sufficient input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#sufficient)
### Content types
You can provide input content as plain text (`text/plain`), HTML (`text/html`), or JSON (`application/json`) by specifying the **Content-Type** parameter. The default is `text/plain`. * Per the JSON specification, the default character encoding for JSON content is effectively always UTF-8. * Per the HTTP specification, the default encoding for plain text and HTML is ISO-8859-1 (effectively, the ASCII character set).
When specifying a content type of plain text or HTML, include the `charset` parameter to indicate the character encoding of the input text; for example, `Content-Type: text/plain;charset=utf-8`.
**See also:** [Specifying request and response formats](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#formats)
### Accept types
You must request a response as JSON (`application/json`) or comma-separated values (`text/csv`) by specifying the **Accept** parameter. CSV output includes a fixed number of columns. Set the **csv_headers** parameter to `true` to request optional column headers for CSV output.
**See also:** * [Understanding a JSON profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-output#output) * [Understanding a CSV profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-outputCSV#outputCSV).
profileOptions - the ProfileOptions containing the options for the callServiceCall with a result of type Profilepublic com.ibm.cloud.sdk.core.http.ServiceCall<java.io.InputStream> profileAsCsv(ProfileOptions profileOptions)
Generates a personality profile for the author of the input text. The service accepts a maximum of 20 MB of input content, but it requires much less text to produce an accurate profile. The service can analyze text in Arabic, English, Japanese, Korean, or Spanish. It can return its results in a variety of languages.
**See also:** * [Requesting a profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#input) * [Providing sufficient input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#sufficient)
### Content types
You can provide input content as plain text (`text/plain`), HTML (`text/html`), or JSON (`application/json`) by specifying the **Content-Type** parameter. The default is `text/plain`. * Per the JSON specification, the default character encoding for JSON content is effectively always UTF-8. * Per the HTTP specification, the default encoding for plain text and HTML is ISO-8859-1 (effectively, the ASCII character set).
When specifying a content type of plain text or HTML, include the `charset` parameter to indicate the character encoding of the input text; for example, `Content-Type: text/plain;charset=utf-8`.
**See also:** [Specifying request and response formats](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#formats)
### Accept types
You must request a response as JSON (`application/json`) or comma-separated values (`text/csv`) by specifying the **Accept** parameter. CSV output includes a fixed number of columns. Set the **csv_headers** parameter to `true` to request optional column headers for CSV output.
**See also:** * [Understanding a JSON profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-output#output) * [Understanding a CSV profile](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-outputCSV#outputCSV).
profileOptions - the ProfileOptions containing the options for the callServiceCall with a result of type String