public class PersonalityInsights extends WatsonService
defaultHeaders, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION
Constructor and Description |
---|
PersonalityInsights()
Instantiates a new Personality Insights service.
|
PersonalityInsights(String username,
String password)
Instantiates a new personality insights service by username and password.
|
Modifier and Type | Method and Description |
---|---|
ServiceCall<Profile> |
getProfile(ProfileOptions options)
Returns a
Profile with a tree of characteristics that include personality, needs, and values. |
ServiceCall<Profile> |
getProfile(String text)
Accepts text and responds with a
Profile with a tree of characteristics that include personality, needs,
and values. |
ServiceCall<String> |
getProfileAsCSV(ProfileOptions options,
boolean includeHeaders)
Returns a CSV profile.
|
configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getToken, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setEndPoint, setSkipAuthentication, setUsernameAndPassword, toString
public PersonalityInsights()
public ServiceCall<Profile> getProfile(String text)
Profile
with a tree of characteristics that include personality, needs,
and values. PersonalityInsights service = new PersonalityInsights(); service.setUsernameAndPassword("username", "password"); String text = "write the text with at least 100 unique words here..." Profile profile = service.getProfile(text).execute(); System.out.println(profile);
text
- Text to analyzeProfile
public ServiceCall<Profile> getProfile(ProfileOptions options)
Profile
with a tree of characteristics that include personality, needs, and values. ProfileOptions
:
PersonalityInsights service = new PersonalityInsights(); service.setUsernameAndPassword("username", "password"); String text = "write the text with at least 100 unique words here..." ContentItem cItem = new ContentItem().content(text).created(new Date()); ProfileOptions options = new ProfileOptions().contentItems(Arrays.asList(cItem)); Profile profile = service.getProfile(options).execute(); System.out.println(profile);
options
- the ProfileOptions
Profile
public ServiceCall<String> getProfileAsCSV(ProfileOptions options, boolean includeHeaders)
options
- the ProfileOptions
includeHeaders
- if true returns the CSV headersCopyright © 2015–2016 IBM Watson. All rights reserved.