public class PersonalityInsights extends WatsonService
defaultHeaders, MESSAGE_CODE, MESSAGE_ERROR, skipAuthentication, VERSION| Constructor and Description |
|---|
PersonalityInsights()
Instantiates a new Personality Insights service.
|
PersonalityInsights(java.lang.String username,
java.lang.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(java.lang.String text)
Accepts text and responds with a
Profile with a tree of characteristics that include personality, needs,
and values. |
ServiceCall<java.lang.String> |
getProfileAsCSV(ProfileOptions options,
boolean includeHeaders)
Returns a CSV profile.
|
configureHttpClient, createServiceCall, getApiKey, getEndPoint, getName, getToken, processServiceCall, setApiKey, setAuthentication, setDefaultHeaders, setDefaultHeaders, setEndPoint, setSkipAuthentication, setUsernameAndPassword, toStringpublic PersonalityInsights()
public PersonalityInsights(java.lang.String username,
java.lang.String password)
username - the usernamepassword - the passwordpublic ServiceCall<Profile> getProfile(java.lang.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 analyzeProfilepublic 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 ProfileOptionsProfilepublic ServiceCall<java.lang.String> getProfileAsCSV(ProfileOptions options, boolean includeHeaders)
options - the ProfileOptionsincludeHeaders - if true returns the CSV headers