Introduction
IBM® will begin sunsetting IBM Watson™ Personality Insights on 1 December 2020. For a period of one year from this date, you will still be able to use Watson Personality Insights. However, as of 1 December 2021, the offering will no longer be available.
As an alternative, we encourage you to consider migrating to IBM Watson™ Natural Language Understanding, a service on IBM Cloud® that uses deep learning to extract data and insights from text such as keywords, categories, sentiment, emotion, and syntax to provide insights for your business or industry. For more information, see About Natural Language Understanding.
The IBM Watson Personality Insights service enables applications to derive insights from social media, enterprise data, or other digital communications. The service uses linguistic analytics to infer individuals' intrinsic personality characteristics, including Big Five, Needs, and Values, from digital communications such as email, text messages, tweets, and forum posts.
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.
- For information about the meaning of the consumption preferences, see Consumption 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.
This documentation describes Java SDK major version 8. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Node SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Python SDK major version 4. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Ruby SDK major version 1. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes .NET Standard SDK major version 4. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Go SDK major version 1. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Swift SDK major version 3. For more information about how to update your code from the previous version, see the migration guide.
This documentation describes Unity SDK major version 4. For more information about how to update your code from the previous version, see the migration guide.
Beginning with version 4.0.0, the Node SDK returns a Promise for all methods when a callback isn't specified.
The package location moved to ibm-watson
. It's available at watson-developer-cloud
but is not updated there. Use ibm-watson
to stay up to date.
The IBM Watson Unity SDK has the following requirements.
- The SDK requires Unity version 2018.2 or later to support Transport Layer Security (TLS) 1.2.
- Set the project settings for both the Scripting Runtime Version and the Api Compatibility Level to
.NET 4.x Equivalent
. - For more information, see TLS 1.0 support.
- Set the project settings for both the Scripting Runtime Version and the Api Compatibility Level to
- The SDK doesn't support the WebGL projects. Change your build settings to any platform except
WebGL
.
For more information about how to install and configure the SDK and SDK Core, see https://github.com/watson-developer-cloud/unity-sdk.
The code examples on this tab use the client library that is provided for Java.
Maven
<dependency>
<groupId>com.ibm.watson</groupId>
<artifactId>ibm-watson</artifactId>
<version>8.6.3</version>
</dependency>
Gradle
compile 'com.ibm.watson:ibm-watson:8.6.3'
GitHub
The code examples on this tab use the client library that is provided for Node.js.
Installation
npm install ibm-watson@^5.7.1
GitHub
The code examples on this tab use the client library that is provided for Python.
Installation
pip install --upgrade "ibm-watson>=4.7.1"
GitHub
The code examples on this tab use the client library that is provided for Ruby.
Installation
gem install ibm_watson
GitHub
The code examples on this tab use the client library that is provided for Go.
go get -u github.com/watson-developer-cloud/go-sdk@v1.7.0
GitHub
The code examples on this tab use the client library that is provided for Swift.
Cocoapods
pod 'IBMWatsonPersonalityInsightsV3', '~> 3.6.0'
Carthage
github "watson-developer-cloud/swift-sdk" ~> 3.6.0
Swift Package Manager
.package(url: "https://github.com/watson-developer-cloud/swift-sdk", from: "3.6.0")
GitHub
The code examples on this tab use the client library that is provided for .NET Standard.
Package Manager
Install-Package IBM.Watson.PersonalityInsights.v3 -Version 4.6.0
.NET CLI
dotnet add package IBM.Watson.PersonalityInsights.v3 --version 4.6.0
PackageReference
<PackageReference Include="IBM.Watson.PersonalityInsights.v3" Version="4.6.0" />
GitHub
The code examples on this tab use the client library that is provided for Unity.
GitHub
Authentication
You authenticate to the API by using IBM Cloud Identity and Access Management (IAM).
You can pass either a bearer token in an authorization header or an API key. Tokens support authenticated requests without embedding service credentials in every call. API keys use basic authentication. For more information, see Authenticating to Watson services.
- For testing and development, you can pass an API key directly.
- For production use, unless you use the Watson SDKs, use an IAM token.
If you pass in an API key, use apikey
for the username and the value of the API key as the password. For example, if the API key is f5sAznhrKQyvBFFaZbtF60m5tzLbqWhyALQawBg5TjRI
in the service credentials, include the credentials in your call like this:
curl -u "apikey:f5sAznhrKQyvBFFaZbtF60m5tzLbqWhyALQawBg5TjRI"
For IBM Cloud instances, the SDK provides initialization methods for each form of authentication.
- Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
- Use the access token to manage the lifecycle yourself. You must periodically refresh the token.
For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.
Replace {apikey}
and {url}
with your service credentials.
curl -X {request_method} -u "apikey:{apikey}" "{url}/v3/{method}"
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
PersonalityInsights personalityInsights = new PersonalityInsights("{version}", authenticator);
personalityInsights.setServiceUrl("{url}");
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
const PersonalityInsightsV3 = require('ibm-watson/personality-insights/v3');
const { IamAuthenticator } = require('ibm-watson/auth');
const personalityInsights = new PersonalityInsightsV3({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
});
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
from ibm_watson import PersonalityInsightsV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
personality_insights = PersonalityInsightsV3(
version='{version}',
authenticator=authenticator
)
personality_insights.set_service_url('{url}')
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
require "ibm_watson/authenticators"
require "ibm_watson/personality_insights_v3"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
personality_insights = PersonalityInsightsV3.new(
version: "{version}",
authenticator: authenticator
)
personality_insights.service_url = "{url}"
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
import (
"github.com/IBM/go-sdk-core/core"
"github.com/watson-developer-cloud/go-sdk/personalityinsightsv3"
)
func main() {
authenticator := &core.IamAuthenticator{
ApiKey: "{apikey}",
}
options := &personalityinsightsv3.PersonalityInsightsV3Options{
Version: "{version}",
Authenticator: authenticator,
}
personalityInsights, personalityInsightsErr := personalityinsightsv3.NewPersonalityInsightsV3(options)
if personalityInsightsErr != nil {
panic(personalityInsightsErr)
}
personalityInsights.SetServiceURL("{url}")
}
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let personalityInsights = PersonalityInsights(version: "{version}", authenticator: authenticator)
personalityInsights.serviceURL = "{url}"
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
PersonalityInsightsService personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("{url}");
SDK managing the IAM token. Replace {apikey}
, {version}
, and {url}
.
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("{url}");
Access between services
Your application might use more than one Watson service. You can grant access between services and you can grant access to more than one service for your applications.
For IBM Cloud services, the method to grant access between Watson services varies depending on the type of API key. For more information, see IAM access.
- To grant access between IBM Cloud services, create an authorization between the services. For more information, see Granting access between services.
- To grant access to your services by applications without using user credentials, create a service ID, add an API key, and assign access policies. For more information, see Creating and working with service IDs.
Make sure that you use an endpoint URL that includes the service instance ID (for example, https://api.us-south.personality-insights.watson.cloud.ibm.com/instances/6bbda3b3-d572-45e1-8c54-22d6ed9e52c2
). You can find the instance ID in two places:
- By clicking the service instance row in the Resource list. The instance ID is the GUID in the details pane.
By clicking the name of the service instance in the list and looking at the credentials URL.
If you don't see the instance ID in the URL, you can add new credentials from the Service credentials page.
IBM Cloud URLs
The base URLs come from the service instance. To find the URL, view the service credentials by clicking the name of the service in the Resource list. Use the value of the URL. Add the method to form the complete API endpoint for your request.
The following example URL represents a Personality Insights instance that is hosted in Washington DC:
https://api.us-east.personality-insights.watson.cloud.ibm.com/instances/6bbda3b3-d572-45e1-8c54-22d6ed9e52c2
The following URLs represent the base URLs for Personality Insights. When you call the API, use the URL that corresponds to the location of your service instance.
- Dallas:
https://api.us-south.personality-insights.watson.cloud.ibm.com
- Washington DC:
https://api.us-east.personality-insights.watson.cloud.ibm.com
- Frankfurt:
https://api.eu-de.personality-insights.watson.cloud.ibm.com
- Sydney:
https://api.au-syd.personality-insights.watson.cloud.ibm.com
- Tokyo:
https://api.jp-tok.personality-insights.watson.cloud.ibm.com
- London:
https://api.eu-gb.personality-insights.watson.cloud.ibm.com
- Seoul:
https://api.kr-seo.personality-insights.watson.cloud.ibm.com
Set the correct service URL by calling the setServiceUrl()
method of the service instance.
Set the correct service URL by specifying the serviceUrl
parameter when you create the service instance.
Set the correct service URL by calling the set_service_url()
method of the service instance.
Set the correct service URL by specifying the service_url
property of the service instance.
Set the correct service URL by calling the SetServiceURL()
method of the service instance.
Set the correct service URL by setting the serviceURL
property of the service instance.
Set the correct service URL by calling the SetServiceUrl()
method of the service instance.
Set the correct service URL by calling the SetServiceUrl()
method of the service instance.
Dallas API endpoint example for services managed on IBM Cloud
curl -X {request_method} -u "apikey:{apikey}" "https://api.us-south.personality-insights.watson.cloud.ibm.com/instances/{instance_id}"
Your service instance might not use this URL
Default URL
https://api.us-south.personality-insights.watson.cloud.ibm.com
Example for the Washington DC location
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
PersonalityInsights personalityInsights = new PersonalityInsights("{version}", authenticator);
personalityInsights.setServiceUrl("https://api.us-east.personality-insights.watson.cloud.ibm.com");
Default URL
https://api.us-south.personality-insights.watson.cloud.ibm.com
Example for the Washington DC location
const PersonalityInsightsV3 = require('ibm-watson/personality-insights/v3');
const { IamAuthenticator } = require('ibm-watson/auth');
const personalityInsights = new PersonalityInsightsV3({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: 'https://api.us-east.personality-insights.watson.cloud.ibm.com',
});
Default URL
https://api.us-south.personality-insights.watson.cloud.ibm.com
Example for the Washington DC location
from ibm_watson import PersonalityInsightsV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
personality_insights = PersonalityInsightsV3(
version='{version}',
authenticator=authenticator
)
personality_insights.set_service_url('https://api.us-east.personality-insights.watson.cloud.ibm.com')
Default URL
https://api.us-south.personality-insights.watson.cloud.ibm.com
Example for the Washington DC location
require "ibm_watson/authenticators"
require "ibm_watson/personality_insights_v3"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
personality_insights = PersonalityInsightsV3.new(
version: "{version}",
authenticator: authenticator
)
personality_insights.service_url = "https://api.us-east.personality-insights.watson.cloud.ibm.com"
Default URL
https://api.us-south.personality-insights.watson.cloud.ibm.com
Example for the Washington DC location
personalityInsights, personalityInsightsErr := personalityinsightsv3.NewPersonalityInsightsV3(options)
if personalityInsightsErr != nil {
panic(personalityInsightsErr)
}
personalityInsights.SetServiceURL("https://api.us-east.personality-insights.watson.cloud.ibm.com")
Default URL
https://api.us-south.personality-insights.watson.cloud.ibm.com
Example for the Washington DC location
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let personalityInsights = PersonalityInsights(version: "{version}", authenticator: authenticator)
personalityInsights.serviceURL = "https://api.us-east.personality-insights.watson.cloud.ibm.com"
Default URL
https://api.us-south.personality-insights.watson.cloud.ibm.com
Example for the Washington DC location
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
PersonalityInsightsService personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("https://api.us-east.personality-insights.watson.cloud.ibm.com");
Default URL
https://api.us-south.personality-insights.watson.cloud.ibm.com
Example for the Washington DC location
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("https://api.us-east.personality-insights.watson.cloud.ibm.com");
Disabling SSL verification
All Watson services use Secure Sockets Layer (SSL) (or Transport Layer Security (TLS)) for secure connections between the client and server. The connection is verified against the local certificate store to ensure authentication, integrity, and confidentiality.
If you use a self-signed certificate, you need to disable SSL verification to make a successful connection.
Enabling SSL verification is highly recommended. Disabling SSL jeopardizes the security of the connection and data. Disable SSL only if necessary, and take steps to enable SSL as soon as possible.
To disable SSL verification for a curl request, use the --insecure
(-k
) option with the request.
To disable SSL verification, create an HttpConfigOptions
object and set the disableSslVerification
property to true
. Then, pass the object to the service instance by using the configureClient
method.
To disable SSL verification, set the disableSslVerification
parameter to true
when you create the service instance.
To disable SSL verification, specify True
on the set_disable_ssl_verification
method for the service instance.
To disable SSL verification, set the disable_ssl_verification
parameter to true
in the configure_http_client()
method for the service instance.
To disable SSL verification, call the DisableSSLVerification
method on the service instance.
To disable SSL verification, call the disableSSLVerification()
method on the service instance. You cannot disable SSL verification on Linux.
To disable SSL verification, set the DisableSslVerification
method to true
on the service instance.
To disable SSL verification, set the DisableSslVerification
method to true
on the service instance.
Example to disable SSL verification. Replace {apikey}
and {url}
with your service credentials.
curl -k -X {request_method} -u "apikey:{apikey}" "{url}/{method}"
Example to disable SSL verification
IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
PersonalityInsights personalityInsights = new PersonalityInsights("{version}", authenticator);
personalityInsights.setServiceUrl("{url}");
HttpConfigOptions configOptions = new HttpConfigOptions.Builder()
.disableSslVerification(true)
.build();
personalityInsights.configureClient(configOptions);
Example to disable SSL verification
const PersonalityInsightsV3 = require('ibm-watson/personality-insights/v3');
const { IamAuthenticator } = require('ibm-watson/auth');
const personalityInsights = new PersonalityInsightsV3({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
disableSslVerification: true,
});
Example to disable SSL verification
from ibm_watson import PersonalityInsightsV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('{apikey}')
personality_insights = PersonalityInsightsV3(
version='{version}',
authenticator=authenticator
)
personality_insights.set_service_url('{url}')
personality_insights.set_disable_ssl_verification(True)
Example to disable SSL verification
require "ibm_watson/authenticators"
require "ibm_watson/personality_insights_v3"
include IBMWatson
authenticator = Authenticators::IamAuthenticator.new(
apikey: "{apikey}"
)
personality_insights = PersonalityInsightsV3.new(
version: "{version}",
authenticator: authenticator
)
personality_insights.service_url = "{url}"
personality_insights.configure_http_client(disable_ssl_verification: true)
Example to disable SSL verification
personalityInsights, personalityInsightsErr := personalityinsightsv3.NewPersonalityInsightsV3(options)
if personalityInsightsErr != nil {
panic(personalityInsightsErr)
}
personalityInsights.SetServiceURL("{url}")
personalityInsights.DisableSSLVerification()
Example to disable SSL verification
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let personalityInsights = PersonalityInsights(version: "{version}", authenticator: authenticator)
personalityInsights.serviceURL = "{url}"
personalityInsights.disableSSLVerification()
Example to disable SSL verification
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
PersonalityInsightsService personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("{url}");
personalityInsights.DisableSslVerification(true);
Example to disable SSL verification
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("{url}");
personalityInsights.DisableSslVerification = true;
Versioning
API requests require a version parameter that takes a date in the format version=YYYY-MM-DD
. When we change the API in a backwards-incompatible way, we release a new version date.
Send the version parameter with every API request. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.
Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.
This documentation describes the current version of Personality Insights, 2017-10-13
. In some cases, differences in earlier versions are noted in the descriptions of parameters and response models.
Error handling
Personality Insights uses standard HTTP response codes to indicate whether a method completed successfully. HTTP response codes in the 2xx range indicate success. A response in the 4xx range is some sort of failure, and a response in the 5xx range usually indicates an internal system error that cannot be resolved by the user. Response codes are listed with the method.
ErrorResponse
Name | Description |
---|---|
code integer |
The HTTP response code. |
sub_code string |
A service-specific error code. |
error string |
General description of an error. |
help string |
A URL to documentation explaining the cause and possibly solutions for the error. |
The Java SDK generates an exception for any unsuccessful method invocation. All methods that accept an argument can also throw an IllegalArgumentException
.
Exception | Description |
---|---|
IllegalArgumentException | An invalid argument was passed to the method. |
When the Java SDK receives an error response from the Personality Insights service, it generates an exception from the com.ibm.watson.developer_cloud.service.exception
package. All service exceptions contain the following fields.
Field | Description |
---|---|
statusCode | The HTTP response code that is returned. |
message | A message that describes the error. |
When the Node SDK receives an error response from the Personality Insights service, it creates an Error
object with information that describes the error that occurred. This error object is passed as the first parameter to the callback function for the method. The contents of the error object are as shown in the following table.
Error
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
The Python SDK generates an exception for any unsuccessful method invocation. When the Python SDK receives an error response from the Personality Insights service, it generates an ApiException
with the following fields.
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
info | A dictionary of additional information about the error. |
When the Ruby SDK receives an error response from the Personality Insights service, it generates an ApiException
with the following fields.
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
info | A dictionary of additional information about the error. |
The Go SDK generates an error for any unsuccessful service instantiation and method invocation. You can check for the error immediately. The contents of the error object are as shown in the following table.
Error
Field | Description |
---|---|
code | The HTTP response code that is returned. |
message | A message that describes the error. |
The Swift SDK returns a WatsonError
in the completionHandler
any unsuccessful method invocation. This error type is an enum that conforms to LocalizedError
and contains an errorDescription
property that returns an error message. Some of the WatsonError
cases contain associated values that reveal more information about the error.
Field | Description |
---|---|
errorDescription | A message that describes the error. |
When the .NET Standard SDK receives an error response from the Personality Insights service, it generates a ServiceResponseException
with the following fields.
Field | Description |
---|---|
Message | A message that describes the error. |
CodeDescription | The HTTP response code that is returned. |
When the Unity SDK receives an error response from the Personality Insights service, it generates an IBMError
with the following fields.
Field | Description |
---|---|
Url | The URL that generated the error. |
StatusCode | The HTTP response code returned. |
ErrorMessage | A message that describes the error. |
Response | The contents of the response from the server. |
ResponseHeaders | A dictionary of headers returned by the request. |
Example error handling
try {
// Invoke a method
} catch (NotFoundException e) {
// Handle Not Found (404) exception
} catch (RequestTooLargeException e) {
// Handle Request Too Large (413) exception
} catch (ServiceResponseException e) {
// Base class for all exceptions caused by error responses from the service
System.out.println("Service returned status code "
+ e.getStatusCode() + ": " + e.getMessage());
}
Example error handling
personalityInsights.method(params)
.catch(err => {
console.log('error:', err);
});
Example error handling
from ibm_watson import ApiException
try:
# Invoke a method
except ApiException as ex:
print "Method failed with status code " + str(ex.code) + ": " + ex.message
Example error handling
require "ibm_watson"
begin
# Invoke a method
rescue IBMWatson::ApiException => ex
print "Method failed with status code #{ex.code}: #{ex.error}"
end
Example error handling
import "github.com/watson-developer-cloud/go-sdk/personalityinsightsv3"
// Instantiate a service
personalityInsights, personalityInsightsErr := personalityinsightsv3.NewPersonalityInsightsV3(options)
// Check for errors
if personalityInsightsErr != nil {
panic(personalityInsightsErr)
}
// Call a method
result, response, responseErr := personalityInsights.MethodName(&methodOptions)
// Check for errors
if responseErr != nil {
panic(responseErr)
}
Example error handling
personalityInsights.method() {
response, error in
if let error = error {
switch error {
case let .http(statusCode, message, metadata):
switch statusCode {
case .some(404):
// Handle Not Found (404) exception
print("Not found")
case .some(413):
// Handle Request Too Large (413) exception
print("Payload too large")
default:
if let statusCode = statusCode {
print("Error - code: \(statusCode), \(message ?? "")")
}
}
default:
print(error.localizedDescription)
}
return
}
guard let result = response?.result else {
print(error?.localizedDescription ?? "unknown error")
return
}
print(result)
}
Example error handling
try
{
// Invoke a method
}
catch(ServiceResponseException e)
{
Console.WriteLine("Error: " + e.Message);
}
catch (Exception e)
{
Console.WriteLine("Error: " + e.Message);
}
Example error handling
// Invoke a method
personalityInsights.MethodName(Callback, Parameters);
// Check for errors
private void Callback(DetailedResponse<ExampleResponse> response, IBMError error)
{
if (error == null)
{
Log.Debug("ExampleCallback", "Response received: {0}", response.Response);
}
else
{
Log.Debug("ExampleCallback", "Error received: {0}, {1}, {3}", error.StatusCode, error.ErrorMessage, error.Response);
}
}
Additional headers
Some Watson services accept special parameters in headers that are passed with the request.
You can pass request header parameters in all requests or in a single request to the service.
To pass a request header, use the --header
(-H
) option with a curl request.
To pass header parameters with every request, use the setDefaultHeaders
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, use the addHeader
method as a modifier on the request before you execute it.
To pass header parameters with every request, specify the headers
parameter when you create the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, use the headers
method as a modifier on the request before you execute it.
To pass header parameters with every request, specify the set_default_headers
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, include headers
as a dict
in the request.
To pass header parameters with every request, specify the add_default_headers
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, specify the headers
method as a chainable method in the request.
To pass header parameters with every request, specify the SetDefaultHeaders
method of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, specify the Headers
as a map
in the request.
To pass header parameters with every request, add them to the defaultHeaders
property of the service object. See Data collection for an example use of this method.
To pass header parameters in a single request, pass the headers
parameter to the request method.
To pass header parameters in a single request, use the WithHeader()
method as a modifier on the request before you execute it. See Data collection for an example use of this method.
To pass header parameters in a single request, use the WithHeader()
method as a modifier on the request before you execute it.
Example header parameter in a request
curl -X {request_method} -H "Request-Header: {header_value}" "{url}/v3/{method}"
Example header parameter in a request
ReturnType returnValue = personalityInsights.methodName(parameters)
.addHeader("Custom-Header", "{header_value}")
.execute();
Example header parameter in a request
const parameters = {
{parameters}
};
personalityInsights.methodName(
parameters,
headers: {
'Custom-Header': '{header_value}'
})
.then(result => {
console.log(response);
})
.catch(err => {
console.log('error:', err);
});
Example header parameter in a request
response = personality_insights.methodName(
parameters,
headers = {
'Custom-Header': '{header_value}'
})
Example header parameter in a request
response = personality_insights.headers(
"Custom-Header" => "{header_value}"
).methodName(parameters)
Example header parameter in a request
result, response, responseErr := personalityInsights.MethodName(
&methodOptions{
Headers: map[string]string{
"Accept": "application/json",
},
},
)
Example header parameter in a request
let customHeader: [String: String] = ["Custom-Header": "{header_value}"]
personalityInsights.methodName(parameters, headers: customHeader) {
response, error in
}
Example header parameter in a request
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
PersonalityInsightsService personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("{url}");
personalityInsights.WithHeader("Custom-Header", "header_value");
Example header parameter in a request
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("{url}");
personalityInsights.WithHeader("Custom-Header", "header_value");
Response details
The Personality Insights service might return information to the application in response headers.
To access all response headers that the service returns, include the --include
(-i
) option with a curl request. To see detailed response data for the request, including request headers, response headers, and extra debugging information, include the --verbose
(-v
) option with the request.
Example request to access response headers
curl -X {request_method} {authentication_method} --include "{url}/v3/{method}"
To access information in the response headers, use one of the request methods that returns details with the response: executeWithDetails()
, enqueueWithDetails()
, or rxWithDetails()
. These methods return a Response<T>
object, where T
is the expected response model. Use the getResult()
method to access the response object for the method, and use the getHeaders()
method to access information in response headers.
Example request to access response headers
Response<ReturnType> response = personalityInsights.methodName(parameters)
.executeWithDetails();
// Access response from methodName
ReturnType returnValue = response.getResult();
// Access information in response headers
Headers responseHeaders = response.getHeaders();
All response data is available in the Response<T>
object that is returned by each method. To access information in the response
object, use the following properties.
Property | Description |
---|---|
result |
Returns the response for the service-specific method. |
headers |
Returns the response header information. |
status |
Returns the HTTP status code. |
Example request to access response headers
personalityInsights.methodName(parameters)
.then(response => {
console.log(response.headers);
})
.catch(err => {
console.log('error:', err);
});
The return value from all service methods is a DetailedResponse
object. To access information in the result object or response headers, use the following methods.
DetailedResponse
Method | Description |
---|---|
get_result() |
Returns the response for the service-specific method. |
get_headers() |
Returns the response header information. |
get_status_code() |
Returns the HTTP status code. |
Example request to access response headers
personality_insights.set_detailed_response(True)
response = personality_insights.methodName(parameters)
# Access response from methodName
print(json.dumps(response.get_result(), indent=2))
# Access information in response headers
print(response.get_headers())
# Access HTTP response status
print(response.get_status_code())
The return value from all service methods is a DetailedResponse
object. To access information in the response
object, use the following properties.
DetailedResponse
Property | Description |
---|---|
result |
Returns the response for the service-specific method. |
headers |
Returns the response header information. |
status |
Returns the HTTP status code. |
Example request to access response headers
response = personality_insights.methodName(parameters)
# Access response from methodName
print response.result
# Access information in response headers
print response.headers
# Access HTTP response status
print response.status
The return value from all service methods is a DetailedResponse
object. To access information in the response
object or response headers, use the following methods.
DetailedResponse
Method | Description |
---|---|
GetResult() |
Returns the response for the service-specific method. |
GetHeaders() |
Returns the response header information. |
GetStatusCode() |
Returns the HTTP status code. |
Example request to access response headers
import (
"github.com/IBM/go-sdk-core/core"
"github.com/watson-developer-cloud/go-sdk/personalityinsightsv3"
)
result, response, responseErr := personalityInsights.MethodName(
&methodOptions{})
// Access result
core.PrettyPrint(response.GetResult(), "Result ")
// Access response headers
core.PrettyPrint(response.GetHeaders(), "Headers ")
// Access status code
core.PrettyPrint(response.GetStatusCode(), "Status Code ")
All response data is available in the WatsonResponse<T>
object that is returned in each method's completionHandler
.
Example request to access response headers
personalityInsights.methodName(parameters) {
response, error in
guard let result = response?.result else {
print(error?.localizedDescription ?? "unknown error")
return
}
print(result) // The data returned by the service
print(response?.statusCode)
print(response?.headers)
}
The response contains fields for response headers, response JSON, and the status code.
DetailedResponse
Property | Description |
---|---|
Result |
Returns the result for the service-specific method. |
Response |
Returns the raw JSON response for the service-specific method. |
Headers |
Returns the response header information. |
StatusCode |
Returns the HTTP status code. |
Example request to access response headers
var results = personalityInsights.MethodName(parameters);
var result = results.Result; // The result object
var responseHeaders = results.Headers; // The response headers
var responseJson = results.Response; // The raw response JSON
var statusCode = results.StatusCode; // The response status code
The response contains fields for response headers, response JSON, and the status code.
DetailedResponse
Property | Description |
---|---|
Result |
Returns the result for the service-specific method. |
Response |
Returns the raw JSON response for the service-specific method. |
Headers |
Returns the response header information. |
StatusCode |
Returns the HTTP status code. |
Example request to access response headers
private void Example()
{
personalityInsights.MethodName(Callback, Parameters);
}
private void Callback(DetailedResponse<ResponseType> response, IBMError error)
{
var result = response.Result; // The result object
var responseHeaders = response.Headers; // The response headers
var responseJson = reresponsesults.Response; // The raw response JSON
var statusCode = response.StatusCode; // The response status code
}
Data collection
By default, Personality Insights service instances that are not part of Premium plans log requests and their results. Logging is done only to improve the services for future users. The logged data is not shared or made public. Logging is disabled for services that are part of Premium plans.
To prevent IBM usage of your data for an API request, set the X-Watson-Learning-Opt-Out header parameter to true
.
You must set the header on each request that you do not want IBM to access for general service improvements.
You can set the header by using the setDefaultHeaders
method of the service object.
You can set the header by using the headers
parameter when you create the service object.
You can set the header by using the set_default_headers
method of the service object.
You can set the header by using the add_default_headers
method of the service object.
You can set the header by using the SetDefaultHeaders
method of the service object.
You can set the header by adding it to the defaultHeaders
property of the service object.
You can set the header by using the WithHeader()
method of the service object.
Example request
curl -u "apikey:{apikey}" -H "X-Watson-Learning-Opt-Out: true" "{url}/{method}"
Example request
Map<String, String> headers = new HashMap<String, String>();
headers.put("X-Watson-Learning-Opt-Out", "true");
personalityInsights.setDefaultHeaders(headers);
Example request
const PersonalityInsightsV3 = require('ibm-watson/personality-insights/v3');
const { IamAuthenticator } = require('ibm-watson/auth');
const personalityInsights = new PersonalityInsightsV3({
version: '{version}',
authenticator: new IamAuthenticator({
apikey: '{apikey}',
}),
serviceUrl: '{url}',
headers: {
'X-Watson-Learning-Opt-Out': 'true'
}
});
Example request
personality_insights.set_default_headers({'x-watson-learning-opt-out': "true"})
Example request
personality_insights.add_default_headers(headers: {"x-watson-learning-opt-out" => "true"})
Example request
import "net/http"
headers := http.Header{}
headers.Add("x-watson-learning-opt-out", "true")
personalityInsights.SetDefaultHeaders(headers)
Example request
personalityInsights.defaultHeaders["X-Watson-Learning-Opt-Out"] = "true"
Example request
IamAuthenticator authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
PersonalityInsightsService personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("{url}");
personalityInsights.WithHeader("X-Watson-Learning-Opt-Out", "true");
Example request
var authenticator = new IamAuthenticator(
apikey: "{apikey}"
);
while (!authenticator.CanAuthenticate())
yield return null;
var personalityInsights = new PersonalityInsightsService("{version}", authenticator);
personalityInsights.SetServiceUrl("{url}");
personalityInsights.WithHeader("X-Watson-Learning-Opt-Out", "true");
Synchronous and asynchronous requests
The Java SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the ServiceCall interface.
- To call a method synchronously, use the
execute
method of theServiceCall
interface. You can call theexecute
method directly from an instance of the service. - To call a method asynchronously, use the
enqueue
method of theServiceCall
interface to receive a callback when the response arrives. The ServiceCallback interface of the method's argument providesonResponse
andonFailure
methods that you override to handle the callback.
The Ruby SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the Concurrent::Async module. When you use the synchronous or asynchronous methods, an IVar object is returned. You access the DetailedResponse
object by calling ivar_object.value
.
For more information about the Ivar object, see the IVar class docs.
To call a method synchronously, either call the method directly or use the
.await
chainable method of theConcurrent::Async
module.Calling a method directly (without
.await
) returns aDetailedResponse
object.- To call a method asynchronously, use the
.async
chainable method of theConcurrent::Async
module.
You can call the .await
and .async
methods directly from an instance of the service.
Example synchronous request
ReturnType returnValue = personalityInsights.method(parameters).execute();
Example asynchronous request
personalityInsights.method(parameters).enqueue(new ServiceCallback<ReturnType>() {
@Override public void onResponse(ReturnType response) {
. . .
}
@Override public void onFailure(Exception e) {
. . .
}
});
Example synchronous request
response = personality_insights.method_name(parameters)
or
response = personality_insights.await.method_name(parameters)
Example asynchronous request
response = personality_insights.async.method_name(parameters)
Related information
- Personality Insights docs
- Release notes
- Javadoc for PersonalityInsights
- Javadoc for sdk-core
Methods
Get profile
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:
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
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:
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:
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
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:
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:
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
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:
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:
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
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:
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:
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
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:
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:
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
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:
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:
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
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:
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:
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
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:
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:
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
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:
POST /v3/profile
(personalityInsights *PersonalityInsightsV3) Profile(profileOptions *ProfileOptions) (result *Profile, response *core.DetailedResponse, err error)
(personalityInsights *PersonalityInsightsV3) ProfileAsCsv(profileOptions *ProfileOptions) (result io.ReadCloser, response *core.DetailedResponse, err error)
ServiceCall<Profile> profile(ProfileOptions profileOptions)
ServiceCall<InputStream> profileAsCsv(ProfileOptions profileOptions)
profile(params, [callback()])
profileAsCsv(params, [callback()])
profile(self, content, accept, content_type=None, content_language=None, accept_language=None, raw_scores=None, csv_headers=None, consumption_preferences=None, **kwargs)
profile(content:, accept:, content_type: nil, content_language: nil, accept_language: nil, raw_scores: nil, csv_headers: nil, consumption_preferences: nil)
func profile(
profileContent: ProfileContent,
contentLanguage: String? = nil,
acceptLanguage: String? = nil,
rawScores: Bool? = nil,
csvHeaders: Bool? = nil,
consumptionPreferences: Bool? = nil,
headers: [String: String]? = nil,
completionHandler: @escaping (WatsonResponse<Profile>?, WatsonError?) -> Void)
func profileAsCSV(
profileContent: ProfileContent,
contentLanguage: String? = nil,
acceptLanguage: String? = nil,
rawScores: Bool? = nil,
csvHeaders: Bool? = nil,
consumptionPreferences: Bool? = nil,
headers: [String: String]? = nil,
completionHandler: @escaping (WatsonResponse<Data>?, WatsonError?) -> Void)
Profile(Content content, string contentType = null, string contentLanguage = null, string acceptLanguage = null, bool? rawScores = null, bool? csvHeaders = null, bool? consumptionPreferences = null)
ProfileAsCsv(Content content, string contentType = null, string contentLanguage = null, string acceptLanguage = null, bool? rawScores = null, bool? csvHeaders = null, bool? consumptionPreferences = null)
Profile(Callback<Profile> callback, Content content, string contentType = null, string contentLanguage = null, string acceptLanguage = null, bool? rawScores = null, bool? csvHeaders = null, bool? consumptionPreferences = null)
ProfileAsCsv(Callback<System.IO.MemoryStream> callback, Content content, string contentType = null, string contentLanguage = null, string acceptLanguage = null, bool? rawScores = null, bool? csvHeaders = null, bool? consumptionPreferences = null)
Request
Instantiate the ProfileOptions
struct and set the fields to provide parameter values for the Profile
method.
Use the ProfileOptions.Builder
to create a ProfileOptions
object that contains the parameter values for the profile
method.
Custom Headers
The type of the response. For more information, see Accept types in the method description.
Allowable values: [
application/json
,text/csv
]The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as their parent language; for example,
en-US
is interpreted asen
.The effect of the Content-Language parameter depends on the Content-Type parameter. When Content-Type is
text/plain
ortext/html
, Content-Language is the only way to specify the language. When Content-Type isapplication/json
, Content-Language overrides a language specified with thelanguage
parameter of aContentItem
object, and content items that specify a different language are ignored; omit this parameter to base the language on the specification of the content items. You can specify any combination of languages for Content-Language and Accept-Language.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example,
en-US
is interpreted asen
. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,de
,en
,es
,fr
,it
,ja
,ko
,pt-br
,zh-cn
,zh-tw
]Default:
en
The type of the input. For more information, see Content types in the method description.
Allowable values: [
application/json
,text/html
,text/plain
]
Query Parameters
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
.Indicates whether a raw score in addition to a normalized percentile is returned for each characteristic; raw scores are not compared with a sample population. By default, only normalized percentiles are returned.
Default:
false
Indicates whether column labels are returned with a CSV response. By default, no column labels are returned. Applies only when the response type is CSV (
text/csv
).Default:
false
Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
Default:
false
A maximum of 20 MB of content to analyze, though the service requires much less text; for more information, see Providing sufficient input. For JSON input, provide an object of type Content
.
An array of
ContentItem
objects that provides the text that is to be analyzed.
The Profile options.
A maximum of 20 MB of content to analyze, though the service requires much less text; for more information, see Providing sufficient input. For JSON input, provide an object of type
Content
.An array of
ContentItem
objects that provides the text that is to be analyzed.The content that is to be analyzed. The service supports up to 20 MB of content for all
ContentItem
objects combined.A unique identifier for this content item.
A timestamp that identifies when this content was created. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
A timestamp that identifies when this content was last updated. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
The MIME type of the content. The default is plain text. The tags are stripped from HTML content before it is analyzed; plain text is processed as submitted.
Allowable values: [
text/plain
,text/html
]Default:
text/plain
The language identifier (two-letter ISO 639-1 identifier) for the language of the content item. The default is
en
(English). Regional variants are treated as their parent language; for example,en-US
is interpreted asen
. A language specified with the Content-Type parameter overrides the value of this parameter; any content items that specify a different language are ignored. Omit the Content-Type parameter to base the language on the most prevalent specification among the content items; again, content items that specify a different language are ignored. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The unique ID of the parent content item for this item. Used to identify hierarchical relationships between posts/replies, messages/replies, and so on.
Indicates whether this content item is a reply to another content item.
Default:
false
Indicates whether this content item is a forwarded/copied version of another content item.
Default:
false
ContentItems
Content
A maximum of 20 MB of content to analyze, though the service requires much less text; for more information, see Providing sufficient input. For JSON input, provide an object of type
Content
.The type of the input. For more information, see Content types in the method description.
Allowable values: [
application/json
,text/html
,text/plain
]Default:
text/plain
The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as their parent language; for example,
en-US
is interpreted asen
.The effect of the Content-Language parameter depends on the Content-Type parameter. When Content-Type is
text/plain
ortext/html
, Content-Language is the only way to specify the language. When Content-Type isapplication/json
, Content-Language overrides a language specified with thelanguage
parameter of aContentItem
object, and content items that specify a different language are ignored; omit this parameter to base the language on the specification of the content items. You can specify any combination of languages for Content-Language and Accept-Language.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example,
en-US
is interpreted asen
. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,de
,en
,es
,fr
,it
,ja
,ko
,pt-br
,zh-cn
,zh-tw
]Default:
en
Indicates whether a raw score in addition to a normalized percentile is returned for each characteristic; raw scores are not compared with a sample population. By default, only normalized percentiles are returned.
Default:
false
Indicates whether column labels are returned with a CSV response. By default, no column labels are returned. Applies only when the response type is CSV (
text/csv
).Default:
false
Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
Default:
false
The profile options.
A maximum of 20 MB of content to analyze, though the service requires much less text; for more information, see Providing sufficient input. For JSON input, provide an object of type
Content
.An array of
ContentItem
objects that provides the text that is to be analyzed.The content that is to be analyzed. The service supports up to 20 MB of content for all
ContentItem
objects combined.A unique identifier for this content item.
A timestamp that identifies when this content was created. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
A timestamp that identifies when this content was last updated. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
The MIME type of the content. The default is plain text. The tags are stripped from HTML content before it is analyzed; plain text is processed as submitted.
Allowable values: [
text/plain
,text/html
]Default:
text/plain
The language identifier (two-letter ISO 639-1 identifier) for the language of the content item. The default is
en
(English). Regional variants are treated as their parent language; for example,en-US
is interpreted asen
. A language specified with the Content-Type parameter overrides the value of this parameter; any content items that specify a different language are ignored. Omit the Content-Type parameter to base the language on the most prevalent specification among the content items; again, content items that specify a different language are ignored. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The unique ID of the parent content item for this item. Used to identify hierarchical relationships between posts/replies, messages/replies, and so on.
Indicates whether this content item is a reply to another content item.
Default:
false
Indicates whether this content item is a forwarded/copied version of another content item.
Default:
false
contentItems
content
A maximum of 20 MB of content to analyze, though the service requires much less text; for more information, see Providing sufficient input. For JSON input, provide an object of type
Content
.The type of the input. For more information, see Content types in the method description.
Allowable values: [
application/json
,text/html
,text/plain
]Default:
text/plain
The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as their parent language; for example,
en-US
is interpreted asen
.The effect of the Content-Language parameter depends on the Content-Type parameter. When Content-Type is
text/plain
ortext/html
, Content-Language is the only way to specify the language. When Content-Type isapplication/json
, Content-Language overrides a language specified with thelanguage
parameter of aContentItem
object, and content items that specify a different language are ignored; omit this parameter to base the language on the specification of the content items. You can specify any combination of languages for Content-Language and Accept-Language.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example,
en-US
is interpreted asen
. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,de
,en
,es
,fr
,it
,ja
,ko
,pt-br
,zh-cn
,zh-tw
]Default:
en
Indicates whether a raw score in addition to a normalized percentile is returned for each characteristic; raw scores are not compared with a sample population. By default, only normalized percentiles are returned.
Default:
false
Indicates whether column labels are returned with a CSV response. By default, no column labels are returned. Applies only when the response type is CSV (
text/csv
).Default:
false
Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
Default:
false
parameters
A maximum of 20 MB of content to analyze, though the service requires much less text; for more information, see Providing sufficient input. For JSON input, provide an object of type
Content
.The type of the input. For more information, see Content types in the method description.
Allowable values: [
application/json
,text/html
,text/plain
]Default:
text/plain
The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as their parent language; for example,
en-US
is interpreted asen
.The effect of the Content-Language parameter depends on the Content-Type parameter. When Content-Type is
text/plain
ortext/html
, Content-Language is the only way to specify the language. When Content-Type isapplication/json
, Content-Language overrides a language specified with thelanguage
parameter of aContentItem
object, and content items that specify a different language are ignored; omit this parameter to base the language on the specification of the content items. You can specify any combination of languages for Content-Language and Accept-Language.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example,
en-US
is interpreted asen
. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,de
,en
,es
,fr
,it
,ja
,ko
,pt-br
,zh-cn
,zh-tw
]Default:
en
Indicates whether a raw score in addition to a normalized percentile is returned for each characteristic; raw scores are not compared with a sample population. By default, only normalized percentiles are returned.
Default:
false
Indicates whether column labels are returned with a CSV response. By default, no column labels are returned. Applies only when the response type is CSV (
text/csv
).Default:
false
Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
Default:
false
parameters
The full input content that the service is to analyze.
An array of
ContentItem
objects that provides the text that is to be analyzed.The content that is to be analyzed. The service supports up to 20 MB of content for all
ContentItem
objects combined.A unique identifier for this content item.
A timestamp that identifies when this content was created. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
A timestamp that identifies when this content was last updated. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
The MIME type of the content. The default is plain text. The tags are stripped from HTML content before it is analyzed; plain text is processed as submitted.
Allowable values: [
text/plain
,text/html
]Default:
text/plain
The language identifier (two-letter ISO 639-1 identifier) for the language of the content item. The default is
en
(English). Regional variants are treated as their parent language; for example,en-US
is interpreted asen
. A language specified with the Content-Type parameter overrides the value of this parameter; any content items that specify a different language are ignored. Omit the Content-Type parameter to base the language on the most prevalent specification among the content items; again, content items that specify a different language are ignored. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The unique ID of the parent content item for this item. Used to identify hierarchical relationships between posts/replies, messages/replies, and so on.
Indicates whether this content item is a reply to another content item.
Default:
false
Indicates whether this content item is a forwarded/copied version of another content item.
Default:
false
content_items
Content
The type of the response. For more information, see Accept types in the method description.
Allowable values: [
application/json
,text/csv
]The type of the input. For more information, see Content types in the method description.
Allowable values: [
application/json
,text/html
,text/plain
]Default:
text/plain
The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as their parent language; for example,
en-US
is interpreted asen
.The effect of the Content-Language parameter depends on the Content-Type parameter. When Content-Type is
text/plain
ortext/html
, Content-Language is the only way to specify the language. When Content-Type isapplication/json
, Content-Language overrides a language specified with thelanguage
parameter of aContentItem
object, and content items that specify a different language are ignored; omit this parameter to base the language on the specification of the content items. You can specify any combination of languages for Content-Language and Accept-Language.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example,
en-US
is interpreted asen
. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,de
,en
,es
,fr
,it
,ja
,ko
,pt-br
,zh-cn
,zh-tw
]Default:
en
Indicates whether a raw score in addition to a normalized percentile is returned for each characteristic; raw scores are not compared with a sample population. By default, only normalized percentiles are returned.
Default:
false
Indicates whether column labels are returned with a CSV response. By default, no column labels are returned. Applies only when the response type is CSV (
text/csv
).Default:
false
Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
Default:
false
parameters
The full input content that the service is to analyze.
An array of
ContentItem
objects that provides the text that is to be analyzed.The content that is to be analyzed. The service supports up to 20 MB of content for all
ContentItem
objects combined.A unique identifier for this content item.
A timestamp that identifies when this content was created. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
A timestamp that identifies when this content was last updated. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
The MIME type of the content. The default is plain text. The tags are stripped from HTML content before it is analyzed; plain text is processed as submitted.
Allowable values: [
text/plain
,text/html
]Default:
text/plain
The language identifier (two-letter ISO 639-1 identifier) for the language of the content item. The default is
en
(English). Regional variants are treated as their parent language; for example,en-US
is interpreted asen
. A language specified with the Content-Type parameter overrides the value of this parameter; any content items that specify a different language are ignored. Omit the Content-Type parameter to base the language on the most prevalent specification among the content items; again, content items that specify a different language are ignored. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The unique ID of the parent content item for this item. Used to identify hierarchical relationships between posts/replies, messages/replies, and so on.
Indicates whether this content item is a reply to another content item.
Default:
false
Indicates whether this content item is a forwarded/copied version of another content item.
Default:
false
content_items
Content
The type of the response. For more information, see Accept types in the method description.
Allowable values: [
application/json
,text/csv
]The type of the input. For more information, see Content types in the method description.
Allowable values: [
application/json
,text/html
,text/plain
]Default:
text/plain
The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as their parent language; for example,
en-US
is interpreted asen
.The effect of the Content-Language parameter depends on the Content-Type parameter. When Content-Type is
text/plain
ortext/html
, Content-Language is the only way to specify the language. When Content-Type isapplication/json
, Content-Language overrides a language specified with thelanguage
parameter of aContentItem
object, and content items that specify a different language are ignored; omit this parameter to base the language on the specification of the content items. You can specify any combination of languages for Content-Language and Accept-Language.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example,
en-US
is interpreted asen
. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,de
,en
,es
,fr
,it
,ja
,ko
,pt-br
,zh-cn
,zh-tw
]Default:
en
Indicates whether a raw score in addition to a normalized percentile is returned for each characteristic; raw scores are not compared with a sample population. By default, only normalized percentiles are returned.
Default:
false
Indicates whether column labels are returned with a CSV response. By default, no column labels are returned. Applies only when the response type is CSV (
text/csv
).Default:
false
Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
Default:
false
parameters
A maximum of 20 MB of content to analyze, though the service requires much less text; for more information, see Providing sufficient input. For JSON input, provide an object of type
Content
.The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as their parent language; for example,
en-US
is interpreted asen
.The effect of the Content-Language parameter depends on the Content-Type parameter. When Content-Type is
text/plain
ortext/html
, Content-Language is the only way to specify the language. When Content-Type isapplication/json
, Content-Language overrides a language specified with thelanguage
parameter of aContentItem
object, and content items that specify a different language are ignored; omit this parameter to base the language on the specification of the content items. You can specify any combination of languages for Content-Language and Accept-Language.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example,
en-US
is interpreted asen
. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,de
,en
,es
,fr
,it
,ja
,ko
,pt-br
,zh-cn
,zh-tw
]Default:
en
Indicates whether a raw score in addition to a normalized percentile is returned for each characteristic; raw scores are not compared with a sample population. By default, only normalized percentiles are returned.
Default:
false
Indicates whether column labels are returned with a CSV response. By default, no column labels are returned. Applies only when the response type is CSV (
text/csv
).Default:
false
Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
Default:
false
parameters
The full input content that the service is to analyze.
An array of
ContentItem
objects that provides the text that is to be analyzed.The content that is to be analyzed. The service supports up to 20 MB of content for all
ContentItem
objects combined.A unique identifier for this content item.
A timestamp that identifies when this content was created. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
A timestamp that identifies when this content was last updated. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
The MIME type of the content. The default is plain text. The tags are stripped from HTML content before it is analyzed; plain text is processed as submitted.
Allowable values: [
text/plain
,text/html
]Default:
text/plain
The language identifier (two-letter ISO 639-1 identifier) for the language of the content item. The default is
en
(English). Regional variants are treated as their parent language; for example,en-US
is interpreted asen
. A language specified with the Content-Type parameter overrides the value of this parameter; any content items that specify a different language are ignored. Omit the Content-Type parameter to base the language on the most prevalent specification among the content items; again, content items that specify a different language are ignored. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The unique ID of the parent content item for this item. Used to identify hierarchical relationships between posts/replies, messages/replies, and so on.
Indicates whether this content item is a reply to another content item.
Default:
false
Indicates whether this content item is a forwarded/copied version of another content item.
Default:
false
ContentItems
Content
The type of the input. For more information, see Content types in the method description.
Allowable values: [
application/json
,text/html
,text/plain
]Default:
text/plain
The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as their parent language; for example,
en-US
is interpreted asen
.The effect of the Content-Language parameter depends on the Content-Type parameter. When Content-Type is
text/plain
ortext/html
, Content-Language is the only way to specify the language. When Content-Type isapplication/json
, Content-Language overrides a language specified with thelanguage
parameter of aContentItem
object, and content items that specify a different language are ignored; omit this parameter to base the language on the specification of the content items. You can specify any combination of languages for Content-Language and Accept-Language.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example,
en-US
is interpreted asen
. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,de
,en
,es
,fr
,it
,ja
,ko
,pt-br
,zh-cn
,zh-tw
]Default:
en
Indicates whether a raw score in addition to a normalized percentile is returned for each characteristic; raw scores are not compared with a sample population. By default, only normalized percentiles are returned.
Default:
false
Indicates whether column labels are returned with a CSV response. By default, no column labels are returned. Applies only when the response type is CSV (
text/csv
).Default:
false
Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
Default:
false
parameters
The full input content that the service is to analyze.
An array of
ContentItem
objects that provides the text that is to be analyzed.The content that is to be analyzed. The service supports up to 20 MB of content for all
ContentItem
objects combined.A unique identifier for this content item.
A timestamp that identifies when this content was created. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
A timestamp that identifies when this content was last updated. Specify a value in milliseconds since the UNIX Epoch (January 1, 1970, at 0:00 UTC). Required only for results that include temporal behavior data.
The MIME type of the content. The default is plain text. The tags are stripped from HTML content before it is analyzed; plain text is processed as submitted.
Allowable values: [
text/plain
,text/html
]Default:
text/plain
The language identifier (two-letter ISO 639-1 identifier) for the language of the content item. The default is
en
(English). Regional variants are treated as their parent language; for example,en-US
is interpreted asen
. A language specified with the Content-Type parameter overrides the value of this parameter; any content items that specify a different language are ignored. Omit the Content-Type parameter to base the language on the most prevalent specification among the content items; again, content items that specify a different language are ignored. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The unique ID of the parent content item for this item. Used to identify hierarchical relationships between posts/replies, messages/replies, and so on.
Indicates whether this content item is a reply to another content item.
Default:
false
Indicates whether this content item is a forwarded/copied version of another content item.
Default:
false
ContentItems
Content
The type of the input. For more information, see Content types in the method description.
Allowable values: [
application/json
,text/html
,text/plain
]Default:
text/plain
The language of the input text for the request: Arabic, English, Japanese, Korean, or Spanish. Regional variants are treated as their parent language; for example,
en-US
is interpreted asen
.The effect of the Content-Language parameter depends on the Content-Type parameter. When Content-Type is
text/plain
ortext/html
, Content-Language is the only way to specify the language. When Content-Type isapplication/json
, Content-Language overrides a language specified with thelanguage
parameter of aContentItem
object, and content items that specify a different language are ignored; omit this parameter to base the language on the specification of the content items. You can specify any combination of languages for Content-Language and Accept-Language.Allowable values: [
ar
,en
,es
,ja
,ko
]Default:
en
The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example,
en-US
is interpreted asen
. You can specify any combination of languages for the input and response content.Allowable values: [
ar
,de
,en
,es
,fr
,it
,ja
,ko
,pt-br
,zh-cn
,zh-tw
]Default:
en
Indicates whether a raw score in addition to a normalized percentile is returned for each characteristic; raw scores are not compared with a sample population. By default, only normalized percentiles are returned.
Default:
false
Indicates whether column labels are returned with a CSV response. By default, no column labels are returned. Applies only when the response type is CSV (
text/csv
).Default:
false
Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
Default:
false
curl -X POST -u "apikey:{apikey}" --header "Content-Type: application/json" --header "Accept: application/json" --data-binary @profile.json "{url}/v3/profile?version=2017-10-13&consumption_preferences=true&raw_scores=true"
Download sample file profile.json
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); PersonalityInsightsService personalityInsights = new PersonalityInsightsService("2017-10-13", authenticator); personalityInsights.SetServiceUrl("{url}"); Content content = null; content = JsonConvert.DeserializeObject<Content>(File.ReadAllText("profile.json")); var result = personalityInsights.Profile( content: content, contentType: "application/json", rawScores: true, consumptionPreferences: true ); Console.WriteLine(result.Response);
Download sample file profile.json
IamAuthenticator authenticator = new IamAuthenticator( apikey: "{apikey}" ); PersonalityInsightsService personalityInsights = new PersonalityInsightsService("2017-10-13", authenticator); personalityInsights.SetServiceUrl("{url}"); Content content = null; content = JsonConvert.DeserializeObject<Content>(File.ReadAllText("profile.json")); var result = personalityInsights.ProfileAsCsv( content: content, contentType: "application/json", consumptionPreferences: true, rawScores: true, csvHeaders: true ); using (FileStream fs = File.Create("output.csv")) { result.Result.WriteTo(fs); fs.Close(); result.Result.Close(); }
Download sample file profile.json
package main import ( "encoding/json" "fmt" "io/ioutil" "github.com/IBM/go-sdk-core/core" "github.com/watson-developer-cloud/go-sdk/personalityinsightsv3" ) func main() { authenticator := &core.IamAuthenticator{ ApiKey: "{apikey}", } options := &personalityinsightsv3.PersonalityInsightsV3Options{ Version: "2017-10-13", Authenticator: authenticator, } personalityInsights, personalityInsightsErr := personalityinsightsv3.NewPersonalityInsightsV3(options) if personalityInsightsErr != nil { panic(personalityInsightsErr) } personalityInsights.SetServiceURL("{url}") profile, profileErr := ioutil.ReadFile("./profile.json") if profileErr != nil { panic(profileErr) } content := new(personalityinsightsv3.Content) json.Unmarshal(profile, content) result, response, responseErr := personalityInsights.Profile( &personalityinsightsv3.ProfileOptions{ Content: content, ContentType: core.StringPtr(personalityinsightsv3.ProfileOptions_ContentType_ApplicationJSON), RawScores: core.BoolPtr(true), ConsumptionPreferences: core.BoolPtr(true), }, ) if responseErr != nil { panic(responseErr) } b, _ := json.MarshalIndent(result, "", " ") fmt.Println(string(b)) }
Download sample file profile.json
IamAuthenticator authenticator = new IamAuthenticator("{apikey}"); PersonalityInsights personalityInsights = new PersonalityInsights("2017-10-13", authenticator); personalityInsights.setServiceUrl("{url}"); try { JsonReader jsonReader = new JsonReader(new FileReader("./profile.json")); Content content = GsonSingleton.getGson().fromJson(jsonReader, Content.class); ProfileOptions profileOptions = new ProfileOptions.Builder() .content(content) .consumptionPreferences(true) .rawScores(true) .build(); Profile profile = personalityInsights.profile(profileOptions).execute().getResult(); System.out.println(profile); } catch (FileNotFoundException e) { e.printStackTrace(); }
Download sample file profile.json
const PersonalityInsightsV3 = require('ibm-watson/personality-insights/v3'); const { IamAuthenticator } = require('ibm-watson/auth'); const personalityInsights = new PersonalityInsightsV3({ version: '2017-10-13', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const profileParams = { // Get the content from the JSON file. content: require('./profile.json'), contentType: 'application/json', consumptionPreferences: true, rawScores: true, }; personalityInsights.profile(profileParams) .then(profile => { console.log(JSON.stringify(profile, null, 2)); }) .catch(err => { console.log('error:', err); });
Download sample file profile.json
const fs = require('fs'); const PersonalityInsightsV3 = require('ibm-watson/personality-insights/v3'); const { IamAuthenticator } = require('ibm-watson/auth'); const personalityInsights = new PersonalityInsightsV3({ version: '2017-10-13', authenticator: new IamAuthenticator({ apikey: '{apikey}', }), serviceUrl: '{url}', }); const profileAsCsvParams = { // Get the content from the JSON file. content: require('./profile.json'), content_type: 'application/json', consumption_preferences: true, raw_scores: true, csv_headers: true, }; personalityInsights.profileAsCsv(profileAsCsvParams) .then(csvData => { const outputFile = fs.createWriteStream('output.csv'); outputFile.write(csvData); outputFile.end(); }) .catch(err => { console.log('error:', err); });
Download sample file profile.json
from ibm_watson import PersonalityInsightsV3 from ibm_cloud_sdk_core.authenticators import IAMAuthenticator from os.path import join, dirname import json authenticator = IAMAuthenticator('{apikey}') personality_insights = PersonalityInsightsV3( version='2017-10-13', authenticator=authenticator ) personality_insights.set_service_url('{url}') with open(join(dirname(__file__), './profile.json')) as profile_json: profile = personality_insights.profile( profile_json.read(), 'application/json', content_type='application/json', consumption_preferences=True, raw_scores=True ).get_result() print(json.dumps(profile, indent=2))
Download sample file profile.json
require "json" require "ibm_watson/authenticators" require "ibm_watson/personality_insights_v3" include IBMWatson authenticator = Authenticators::IamAuthenticator.new( apikey: "{apikey}" ) personality_insights = PersonalityInsightsV3.new( version: "2017-10-13", authenticator: authenticator ) personality_insights.service_url = "{url}" File.open("profile.json") do |profile_json| profile = personality_insights.profile( content: profile_json.read, content_type: "application/json", raw_scores: true, consumption_preferences: true ) puts JSON.pretty_generate(profile.result) end
Download sample file profile.json
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}") let personalityInsights = PersonalityInsights(version: "2017-10-13", authenticator: authenticator) personalityInsights.serviceURL = "{url}" let url = Bundle.main.url(forResource: "profile", withExtension: "json")! let content = try JSONDecoder().decode(Content.self, from: Data(contentsOf: url)) personalityInsights.profile(profileContent: ProfileContent.content(content)) { response, error in guard let profile = response?.result else { print(error?.localizedDescription ?? "unknown error") return } print(profile) }
Download sample file profile.json
var authenticator = new IamAuthenticator( Apikey: "{apikey}" ); while (!authenticator.CanAuthenticate()) yield return null; var personalityInsights = new PersonalityInsightsService("2017-10-13", authenticator); personalityInsights.SetServiceUrl("{url}"); using (StreamReader reader = new StreamReader("./profile.json")) { var json = reader.ReadToEnd(); Content content = JsonConvert.DeserializeObject<Content>(json); personalityInsights.Profile( callback: (DetailedResponse<Profile> response, IBMError error) => { Log.Debug("PersonalityInsightsServiceV3", "Profile result: {0}", response.Response); profileResponse = response.Result; }, content: content, contentType: "application/json", rawScores: true, consumptionPreferences: true ); }
Download sample file profile.json
Response
Response type for Profile
: Profile
Response type for ProfileAsCsv
: io.ReadCloser
Response type for profile
: Profile
Response type for profileAsCsv
: InputStream
Response type for profile
: Profile
Response type for profileAsCsv
: NodeJS.ReadableStream|Buffer
Response type for profile
: Profile
Response type for profileAsCSV
: Data
Response type for Profile
: Profile
Response type for ProfileAsCsv
: System.IO.MemoryStream
Response type for Profile
: Profile
Response type for ProfileAsCsv
: System.IO.MemoryStream
The personality profile that the service generated for the input content.
The language model that was used to process the input.
Possible values: [
ar
,en
,es
,ja
,ko
]The number of words from the input that were used to produce the profile.
A recursive array of
Trait
objects that provides detailed results for the Big Five personality characteristics (dimensions and facets) inferred from the input text.Detailed results for the Needs characteristics inferred from the input text.
Detailed results for the Values characteristics inferred from the input text.
An array of warning messages that are associated with the input text for the request. The array is empty if the input generated no warnings.
When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
For JSON content that is timestamped, detailed results about the social behavior disclosed by the input in terms of temporal characteristics. The results include information about the distribution of the content over the days of the week and the hours of the day.
If the consumption_preferences parameter is
true
, detailed results for each category of consumption preferences. Each element of the array provides information inferred from the input text for the individual preferences of that category.
The personality profile that the service generated for the input content.
The language model that was used to process the input.
Possible values: [
ar
,en
,es
,ja
,ko
]The number of words from the input that were used to produce the profile.
When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
A recursive array of
Trait
objects that provides detailed results for the Big Five personality characteristics (dimensions and facets) inferred from the input text.The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
Personality
Detailed results for the Needs characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
Needs
Detailed results for the Values characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
Values
For JSON content that is timestamped, detailed results about the social behavior disclosed by the input in terms of temporal characteristics. The results include information about the distribution of the content over the days of the week and the hours of the day.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
behavior_{value}
.The user-visible, localized name of the characteristic.
The category of the characteristic:
behavior
for temporal data.For JSON content that is timestamped, the percentage of timestamped input data that occurred during that day of the week or hour of the day. The range is 0 to 1.
Behavior
If the consumption_preferences parameter is
true
, detailed results for each category of consumption preferences. Each element of the array provides information inferred from the input text for the individual preferences of that category.The unique, non-localized identifier of the consumption preferences category to which the results pertain. IDs have the form
consumption_preferences_{category}
.The user-visible name of the consumption preferences category.
Detailed results inferred from the input text for the individual preferences of the category.
The unique, non-localized identifier of the consumption preference to which the results pertain. IDs have the form
consumption_preferences_{preference}
.The user-visible, localized name of the consumption preference.
The score for the consumption preference:
0.0
: Unlikely0.5
: Neutral1.0
: Likely
The scores for some preferences are binary and do not allow a neutral value. The score is an indication of preference based on the results inferred from the input text, not a normalized percentile.
Possible values: [
0
,0.5
,1
]
ConsumptionPreferences
ConsumptionPreferences
An array of warning messages that are associated with the input text for the request. The array is empty if the input generated no warnings.
The identifier of the warning message.
Possible values: [
WORD_COUNT_MESSAGE
,JSON_AS_TEXT
,CONTENT_TRUNCATED
,PARTIAL_TEXT_USED
]The message associated with the
warning_id
:WORD_COUNT_MESSAGE
: "There were {number} words in the input. We need a minimum of 600, preferably 1,200 or more, to compute statistically significant estimates."JSON_AS_TEXT
: "Request input was processed as text/plain as indicated, however detected a JSON input. Did you mean application/json?"CONTENT_TRUNCATED
: "For maximum accuracy while also optimizing processing time, only the first 250KB of input text (excluding markup) was analyzed. Accuracy levels off at approximately 3,000 words so this did not affect the accuracy of the profile."PARTIAL_TEXT_USED
, "The text provided to compute the profile was trimmed for performance reasons. This action does not affect the accuracy of the output, as not all of the input text was required." Applies only when Arabic input text exceeds a threshold at which additional words do not contribute to the accuracy of the profile.
Warnings
The personality profile that the service generated for the input content.
The language model that was used to process the input.
Possible values: [
ar
,en
,es
,ja
,ko
]The number of words from the input that were used to produce the profile.
When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
A recursive array of
Trait
objects that provides detailed results for the Big Five personality characteristics (dimensions and facets) inferred from the input text.The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
personality
Detailed results for the Needs characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
needs
Detailed results for the Values characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
values
For JSON content that is timestamped, detailed results about the social behavior disclosed by the input in terms of temporal characteristics. The results include information about the distribution of the content over the days of the week and the hours of the day.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
behavior_{value}
.The user-visible, localized name of the characteristic.
The category of the characteristic:
behavior
for temporal data.For JSON content that is timestamped, the percentage of timestamped input data that occurred during that day of the week or hour of the day. The range is 0 to 1.
behavior
If the consumption_preferences parameter is
true
, detailed results for each category of consumption preferences. Each element of the array provides information inferred from the input text for the individual preferences of that category.The unique, non-localized identifier of the consumption preferences category to which the results pertain. IDs have the form
consumption_preferences_{category}
.The user-visible name of the consumption preferences category.
Detailed results inferred from the input text for the individual preferences of the category.
The unique, non-localized identifier of the consumption preference to which the results pertain. IDs have the form
consumption_preferences_{preference}
.The user-visible, localized name of the consumption preference.
The score for the consumption preference:
0.0
: Unlikely0.5
: Neutral1.0
: Likely
The scores for some preferences are binary and do not allow a neutral value. The score is an indication of preference based on the results inferred from the input text, not a normalized percentile.
Possible values: [
0
,0.5
,1
]
consumptionPreferences
consumptionPreferences
An array of warning messages that are associated with the input text for the request. The array is empty if the input generated no warnings.
The identifier of the warning message.
Possible values: [
WORD_COUNT_MESSAGE
,JSON_AS_TEXT
,CONTENT_TRUNCATED
,PARTIAL_TEXT_USED
]The message associated with the
warning_id
:WORD_COUNT_MESSAGE
: "There were {number} words in the input. We need a minimum of 600, preferably 1,200 or more, to compute statistically significant estimates."JSON_AS_TEXT
: "Request input was processed as text/plain as indicated, however detected a JSON input. Did you mean application/json?"CONTENT_TRUNCATED
: "For maximum accuracy while also optimizing processing time, only the first 250KB of input text (excluding markup) was analyzed. Accuracy levels off at approximately 3,000 words so this did not affect the accuracy of the profile."PARTIAL_TEXT_USED
, "The text provided to compute the profile was trimmed for performance reasons. This action does not affect the accuracy of the output, as not all of the input text was required." Applies only when Arabic input text exceeds a threshold at which additional words do not contribute to the accuracy of the profile.
warnings
The personality profile that the service generated for the input content.
The language model that was used to process the input.
Possible values: [
ar
,en
,es
,ja
,ko
]The number of words from the input that were used to produce the profile.
When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
A recursive array of
Trait
objects that provides detailed results for the Big Five personality characteristics (dimensions and facets) inferred from the input text.The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
personality
Detailed results for the Needs characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
needs
Detailed results for the Values characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
values
For JSON content that is timestamped, detailed results about the social behavior disclosed by the input in terms of temporal characteristics. The results include information about the distribution of the content over the days of the week and the hours of the day.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
behavior_{value}
.The user-visible, localized name of the characteristic.
The category of the characteristic:
behavior
for temporal data.For JSON content that is timestamped, the percentage of timestamped input data that occurred during that day of the week or hour of the day. The range is 0 to 1.
behavior
If the consumption_preferences parameter is
true
, detailed results for each category of consumption preferences. Each element of the array provides information inferred from the input text for the individual preferences of that category.The unique, non-localized identifier of the consumption preferences category to which the results pertain. IDs have the form
consumption_preferences_{category}
.The user-visible name of the consumption preferences category.
Detailed results inferred from the input text for the individual preferences of the category.
The unique, non-localized identifier of the consumption preference to which the results pertain. IDs have the form
consumption_preferences_{preference}
.The user-visible, localized name of the consumption preference.
The score for the consumption preference:
0.0
: Unlikely0.5
: Neutral1.0
: Likely
The scores for some preferences are binary and do not allow a neutral value. The score is an indication of preference based on the results inferred from the input text, not a normalized percentile.
Possible values: [
0
,0.5
,1
]
consumption_preferences
consumption_preferences
An array of warning messages that are associated with the input text for the request. The array is empty if the input generated no warnings.
The identifier of the warning message.
Possible values: [
WORD_COUNT_MESSAGE
,JSON_AS_TEXT
,CONTENT_TRUNCATED
,PARTIAL_TEXT_USED
]The message associated with the
warning_id
:WORD_COUNT_MESSAGE
: "There were {number} words in the input. We need a minimum of 600, preferably 1,200 or more, to compute statistically significant estimates."JSON_AS_TEXT
: "Request input was processed as text/plain as indicated, however detected a JSON input. Did you mean application/json?"CONTENT_TRUNCATED
: "For maximum accuracy while also optimizing processing time, only the first 250KB of input text (excluding markup) was analyzed. Accuracy levels off at approximately 3,000 words so this did not affect the accuracy of the profile."PARTIAL_TEXT_USED
, "The text provided to compute the profile was trimmed for performance reasons. This action does not affect the accuracy of the output, as not all of the input text was required." Applies only when Arabic input text exceeds a threshold at which additional words do not contribute to the accuracy of the profile.
warnings
The personality profile that the service generated for the input content.
The language model that was used to process the input.
Possible values: [
ar
,en
,es
,ja
,ko
]The number of words from the input that were used to produce the profile.
When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
A recursive array of
Trait
objects that provides detailed results for the Big Five personality characteristics (dimensions and facets) inferred from the input text.The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
personality
Detailed results for the Needs characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
needs
Detailed results for the Values characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
values
For JSON content that is timestamped, detailed results about the social behavior disclosed by the input in terms of temporal characteristics. The results include information about the distribution of the content over the days of the week and the hours of the day.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
behavior_{value}
.The user-visible, localized name of the characteristic.
The category of the characteristic:
behavior
for temporal data.For JSON content that is timestamped, the percentage of timestamped input data that occurred during that day of the week or hour of the day. The range is 0 to 1.
behavior
If the consumption_preferences parameter is
true
, detailed results for each category of consumption preferences. Each element of the array provides information inferred from the input text for the individual preferences of that category.The unique, non-localized identifier of the consumption preferences category to which the results pertain. IDs have the form
consumption_preferences_{category}
.The user-visible name of the consumption preferences category.
Detailed results inferred from the input text for the individual preferences of the category.
The unique, non-localized identifier of the consumption preference to which the results pertain. IDs have the form
consumption_preferences_{preference}
.The user-visible, localized name of the consumption preference.
The score for the consumption preference:
0.0
: Unlikely0.5
: Neutral1.0
: Likely
The scores for some preferences are binary and do not allow a neutral value. The score is an indication of preference based on the results inferred from the input text, not a normalized percentile.
Possible values: [
0
,0.5
,1
]
consumption_preferences
consumption_preferences
An array of warning messages that are associated with the input text for the request. The array is empty if the input generated no warnings.
The identifier of the warning message.
Possible values: [
WORD_COUNT_MESSAGE
,JSON_AS_TEXT
,CONTENT_TRUNCATED
,PARTIAL_TEXT_USED
]The message associated with the
warning_id
:WORD_COUNT_MESSAGE
: "There were {number} words in the input. We need a minimum of 600, preferably 1,200 or more, to compute statistically significant estimates."JSON_AS_TEXT
: "Request input was processed as text/plain as indicated, however detected a JSON input. Did you mean application/json?"CONTENT_TRUNCATED
: "For maximum accuracy while also optimizing processing time, only the first 250KB of input text (excluding markup) was analyzed. Accuracy levels off at approximately 3,000 words so this did not affect the accuracy of the profile."PARTIAL_TEXT_USED
, "The text provided to compute the profile was trimmed for performance reasons. This action does not affect the accuracy of the output, as not all of the input text was required." Applies only when Arabic input text exceeds a threshold at which additional words do not contribute to the accuracy of the profile.
warnings
The personality profile that the service generated for the input content.
The language model that was used to process the input.
Possible values: [
ar
,en
,es
,ja
,ko
]The number of words from the input that were used to produce the profile.
When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
A recursive array of
Trait
objects that provides detailed results for the Big Five personality characteristics (dimensions and facets) inferred from the input text.The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
personality
Detailed results for the Needs characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
needs
Detailed results for the Values characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
values
For JSON content that is timestamped, detailed results about the social behavior disclosed by the input in terms of temporal characteristics. The results include information about the distribution of the content over the days of the week and the hours of the day.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
behavior_{value}
.The user-visible, localized name of the characteristic.
The category of the characteristic:
behavior
for temporal data.For JSON content that is timestamped, the percentage of timestamped input data that occurred during that day of the week or hour of the day. The range is 0 to 1.
behavior
If the consumption_preferences parameter is
true
, detailed results for each category of consumption preferences. Each element of the array provides information inferred from the input text for the individual preferences of that category.The unique, non-localized identifier of the consumption preferences category to which the results pertain. IDs have the form
consumption_preferences_{category}
.The user-visible name of the consumption preferences category.
Detailed results inferred from the input text for the individual preferences of the category.
The unique, non-localized identifier of the consumption preference to which the results pertain. IDs have the form
consumption_preferences_{preference}
.The user-visible, localized name of the consumption preference.
The score for the consumption preference:
0.0
: Unlikely0.5
: Neutral1.0
: Likely
The scores for some preferences are binary and do not allow a neutral value. The score is an indication of preference based on the results inferred from the input text, not a normalized percentile.
Possible values: [
0
,0.5
,1
]
consumption_preferences
consumption_preferences
An array of warning messages that are associated with the input text for the request. The array is empty if the input generated no warnings.
The identifier of the warning message.
Possible values: [
WORD_COUNT_MESSAGE
,JSON_AS_TEXT
,CONTENT_TRUNCATED
,PARTIAL_TEXT_USED
]The message associated with the
warning_id
:WORD_COUNT_MESSAGE
: "There were {number} words in the input. We need a minimum of 600, preferably 1,200 or more, to compute statistically significant estimates."JSON_AS_TEXT
: "Request input was processed as text/plain as indicated, however detected a JSON input. Did you mean application/json?"CONTENT_TRUNCATED
: "For maximum accuracy while also optimizing processing time, only the first 250KB of input text (excluding markup) was analyzed. Accuracy levels off at approximately 3,000 words so this did not affect the accuracy of the profile."PARTIAL_TEXT_USED
, "The text provided to compute the profile was trimmed for performance reasons. This action does not affect the accuracy of the output, as not all of the input text was required." Applies only when Arabic input text exceeds a threshold at which additional words do not contribute to the accuracy of the profile.
warnings
The personality profile that the service generated for the input content.
The language model that was used to process the input.
Possible values: [
ar
,en
,es
,ja
,ko
]The number of words from the input that were used to produce the profile.
When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
A recursive array of
Trait
objects that provides detailed results for the Big Five personality characteristics (dimensions and facets) inferred from the input text.The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
personality
Detailed results for the Needs characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
needs
Detailed results for the Values characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
values
For JSON content that is timestamped, detailed results about the social behavior disclosed by the input in terms of temporal characteristics. The results include information about the distribution of the content over the days of the week and the hours of the day.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
behavior_{value}
.The user-visible, localized name of the characteristic.
The category of the characteristic:
behavior
for temporal data.For JSON content that is timestamped, the percentage of timestamped input data that occurred during that day of the week or hour of the day. The range is 0 to 1.
behavior
If the consumption_preferences parameter is
true
, detailed results for each category of consumption preferences. Each element of the array provides information inferred from the input text for the individual preferences of that category.The unique, non-localized identifier of the consumption preferences category to which the results pertain. IDs have the form
consumption_preferences_{category}
.The user-visible name of the consumption preferences category.
Detailed results inferred from the input text for the individual preferences of the category.
The unique, non-localized identifier of the consumption preference to which the results pertain. IDs have the form
consumption_preferences_{preference}
.The user-visible, localized name of the consumption preference.
The score for the consumption preference:
0.0
: Unlikely0.5
: Neutral1.0
: Likely
The scores for some preferences are binary and do not allow a neutral value. The score is an indication of preference based on the results inferred from the input text, not a normalized percentile.
Possible values: [
0
,0.5
,1
]
consumptionPreferences
consumptionPreferences
An array of warning messages that are associated with the input text for the request. The array is empty if the input generated no warnings.
The identifier of the warning message.
Possible values: [
WORD_COUNT_MESSAGE
,JSON_AS_TEXT
,CONTENT_TRUNCATED
,PARTIAL_TEXT_USED
]The message associated with the
warning_id
:WORD_COUNT_MESSAGE
: "There were {number} words in the input. We need a minimum of 600, preferably 1,200 or more, to compute statistically significant estimates."JSON_AS_TEXT
: "Request input was processed as text/plain as indicated, however detected a JSON input. Did you mean application/json?"CONTENT_TRUNCATED
: "For maximum accuracy while also optimizing processing time, only the first 250KB of input text (excluding markup) was analyzed. Accuracy levels off at approximately 3,000 words so this did not affect the accuracy of the profile."PARTIAL_TEXT_USED
, "The text provided to compute the profile was trimmed for performance reasons. This action does not affect the accuracy of the output, as not all of the input text was required." Applies only when Arabic input text exceeds a threshold at which additional words do not contribute to the accuracy of the profile.
warnings
The personality profile that the service generated for the input content.
The language model that was used to process the input.
Possible values: [
ar
,en
,es
,ja
,ko
]The number of words from the input that were used to produce the profile.
When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
A recursive array of
Trait
objects that provides detailed results for the Big Five personality characteristics (dimensions and facets) inferred from the input text.The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
Personality
Detailed results for the Needs characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
Needs
Detailed results for the Values characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
Values
For JSON content that is timestamped, detailed results about the social behavior disclosed by the input in terms of temporal characteristics. The results include information about the distribution of the content over the days of the week and the hours of the day.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
behavior_{value}
.The user-visible, localized name of the characteristic.
The category of the characteristic:
behavior
for temporal data.For JSON content that is timestamped, the percentage of timestamped input data that occurred during that day of the week or hour of the day. The range is 0 to 1.
Behavior
If the consumption_preferences parameter is
true
, detailed results for each category of consumption preferences. Each element of the array provides information inferred from the input text for the individual preferences of that category.The unique, non-localized identifier of the consumption preferences category to which the results pertain. IDs have the form
consumption_preferences_{category}
.The user-visible name of the consumption preferences category.
Detailed results inferred from the input text for the individual preferences of the category.
The unique, non-localized identifier of the consumption preference to which the results pertain. IDs have the form
consumption_preferences_{preference}
.The user-visible, localized name of the consumption preference.
The score for the consumption preference:
0.0
: Unlikely0.5
: Neutral1.0
: Likely
The scores for some preferences are binary and do not allow a neutral value. The score is an indication of preference based on the results inferred from the input text, not a normalized percentile.
ConsumptionPreferences
ConsumptionPreferences
An array of warning messages that are associated with the input text for the request. The array is empty if the input generated no warnings.
The identifier of the warning message.
Possible values: [
WORD_COUNT_MESSAGE
,JSON_AS_TEXT
,CONTENT_TRUNCATED
,PARTIAL_TEXT_USED
]The message associated with the
warning_id
:WORD_COUNT_MESSAGE
: "There were {number} words in the input. We need a minimum of 600, preferably 1,200 or more, to compute statistically significant estimates."JSON_AS_TEXT
: "Request input was processed as text/plain as indicated, however detected a JSON input. Did you mean application/json?"CONTENT_TRUNCATED
: "For maximum accuracy while also optimizing processing time, only the first 250KB of input text (excluding markup) was analyzed. Accuracy levels off at approximately 3,000 words so this did not affect the accuracy of the profile."PARTIAL_TEXT_USED
, "The text provided to compute the profile was trimmed for performance reasons. This action does not affect the accuracy of the output, as not all of the input text was required." Applies only when Arabic input text exceeds a threshold at which additional words do not contribute to the accuracy of the profile.
Warnings
The personality profile that the service generated for the input content.
The language model that was used to process the input.
Possible values: [
ar
,en
,es
,ja
,ko
]The number of words from the input that were used to produce the profile.
When guidance is appropriate, a string that provides a message that indicates the number of words found and where that value falls in the range of required or suggested number of words.
A recursive array of
Trait
objects that provides detailed results for the Big Five personality characteristics (dimensions and facets) inferred from the input text.The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
Personality
Detailed results for the Needs characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
Needs
Detailed results for the Values characteristics inferred from the input text.
The unique, non-localized identifier of the characteristic to which the results pertain. IDs have the form
big5_{characteristic}
for Big Five personality dimensionsfacet_{characteristic}
for Big Five personality facetsneed_{characteristic}
for Needs *value_{characteristic}
for Values.
The user-visible, localized name of the characteristic.
The category of the characteristic:
personality
for Big Five personality characteristics,needs
for Needs, andvalues
for Values.Possible values: [
personality
,needs
,values
]The normalized percentile score for the characteristic. The range is 0 to 1. For example, if the percentage for Openness is 0.60, the author scored in the 60th percentile; the author is more open than 59 percent of the population and less open than 39 percent of the population.
The raw score for the characteristic. The range is 0 to 1. A higher score generally indicates a greater likelihood that the author has that characteristic, but raw scores must be considered in aggregate: The range of values in practice might be much smaller than 0 to 1, so an individual score must be considered in the context of the overall scores and their range.
The raw score is computed based on the input and the service model; it is not normalized or compared with a sample population. The raw score enables comparison of the results against a different sampling population and with a custom normalization approach.
2017-10-13
: Indicates whether the characteristic is meaningful for the input language. The field is alwaystrue
for all characteristics of English, Spanish, and Japanese input. The field isfalse
for the subset of characteristics of Arabic and Korean input for which the service's models are unable to generate meaningful results.2016-10-19
: Not returned.For
personality
(Big Five) dimensions, more detailed results for the facets of each dimension as inferred from the input text.
Values
For JSON content that is timestamped, detailed results about the social behavior disclosed by the input in terms of temporal characteristics. The results include information about the distribution of the content over the days of the week and the hours of the day.
Behavior