Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PersonalityInsightsV3

IBM Watson™ Personality Insights is discontinued. Existing instances are supported until 1 December 2021, but as of 1 December 2020, you cannot create new instances. Any instance that exists on 1 December 2021 will be deleted.

No direct replacement exists for Personality Insights. However, you can consider using IBM Watson™ Natural Language Understanding on IBM Cloud® as part of a replacement analytic workflow for your Personality Insights use cases. You can use Natural Language Understanding to extract data and insights from text, such as keywords, categories, sentiment, emotion, and syntax. For more information about the personality models in Personality Insights, see The science behind the service. {: deprecated} interfaces

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.

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.

API Version: 3.4.4 See: https://cloud.ibm.com/docs/personality-insights

Hierarchy

  • BaseService
    • PersonalityInsightsV3

Index

Constructors

constructor

Properties

version

version: string

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.

Static DEFAULT_SERVICE_NAME

DEFAULT_SERVICE_NAME: string = "personality_insights"

Static DEFAULT_SERVICE_URL

DEFAULT_SERVICE_URL: string = "https://api.us-south.personality-insights.watson.cloud.ibm.com"

Methods

disableRetries

  • disableRetries(): void
  • Disables retries.

    Returns void

enableRetries

  • enableRetries(retryOptions?: RetryOptions): void
  • Enable retries for unfulfilled requests.

    Parameters

    Name Type Attribute Description
    retryOptions RetryOptions Optional

    configuration for retries

    Returns void

getAuthenticator

  • getAuthenticator(): any
  • Get the instance of the authenticator set on the service.

    Returns any

getHttpClient

  • getHttpClient(): AxiosInstance
  • Get the Axios instance set on the service. All requests will be made using this instance.

    Returns AxiosInstance

profile

  • 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:

    Parameters

    Name Type Attribute Description
    params ProfileParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    content Content | string A maximum of 20 MB of content to analyze, though the service requires much less text; for more information, see [Providing sufficient input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#sufficient). For JSON input, provide an object of type `Content`.
    acceptLanguage AcceptLanguage | string Optional The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example, `en-US` is interpreted as `en`. You can specify any combination of languages for the input and response content.
    consumptionPreferences boolean Optional Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
    contentLanguage ContentLanguage | string Optional 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 as `en`.
    contentType ContentType | string Optional The type of the input. For more information, see **Content types** in the method description.
    csvHeaders boolean Optional 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`).
    headers OutgoingHttpHeaders Optional
    rawScores boolean Optional 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.

    Returns Promise<Response<Profile>>

profileAsCsv

  • Get profile as csv.

    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:

    Parameters

    Name Type Attribute Description
    params ProfileAsCsvParams

    The parameters to send to the service.

    Properties

    Name Type Attributes Description
    content Content | string A maximum of 20 MB of content to analyze, though the service requires much less text; for more information, see [Providing sufficient input](https://cloud.ibm.com/docs/personality-insights?topic=personality-insights-input#sufficient). For JSON input, provide an object of type `Content`.
    acceptLanguage AcceptLanguage | string Optional The desired language of the response. For two-character arguments, regional variants are treated as their parent language; for example, `en-US` is interpreted as `en`. You can specify any combination of languages for the input and response content.
    consumptionPreferences boolean Optional Indicates whether consumption preferences are returned with the results. By default, no consumption preferences are returned.
    contentLanguage ContentLanguage | string Optional 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 as `en`.
    contentType ContentType | string Optional The type of the input. For more information, see **Content types** in the method description.
    csvHeaders boolean Optional 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`).
    headers OutgoingHttpHeaders Optional
    rawScores boolean Optional 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.

    Returns Promise<Response<ReadableStream>>

setEnableGzipCompression

  • setEnableGzipCompression(setting: boolean): void
  • Turn request body compression on or off.

    Parameters

    Name Type Attribute Description
    setting boolean

    Will turn it on if 'true', off if 'false'.

    Returns void

setServiceUrl

  • setServiceUrl(url: string): void
  • Set the service URL to send requests to.

    Parameters

    Name Type Attribute Description
    url string

    The base URL for the service.

    Returns void

Generated using TypeDoc