EmotionOptions

public struct EmotionOptions : Codable, Equatable

Detects anger, disgust, fear, joy, or sadness that is conveyed in the content or by the context around target phrases specified in the targets parameter. You can analyze emotion for detected entities with entities.emotion and for keywords with keywords.emotion. Supported languages: English.

  • Set this to false to hide document-level emotion results.

    Declaration

    Swift

    public var document: Bool?
  • Emotion results will be returned for each target string that is found in the document.

    Declaration

    Swift

    public var targets: [String]?
  • Initialize a EmotionOptions with member variables.

    Declaration

    Swift

    public init(
        document: Bool? = nil,
        targets: [String]? = nil
    )

    Parameters

    document

    Set this to false to hide document-level emotion results.

    targets

    Emotion results will be returned for each target string that is found in the document.

    Return Value

    An initialized EmotionOptions.