Class: Google::Cloud::Language::V1::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb

Overview

Represents a phrase in the text that is a known entity, such as a person, an organization, or location. The API associates information, such as salience and mentions, with entities.

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Instance Attribute Details

#mentionsArray<Google::Cloud::Language::V1::EntityMention>

Returns The mentions of this entity in the input document. The API currently supports proper noun mentions.

Returns:



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 114

class Entity
  # The type of the entity.
  module Type
    # Unknown
    UNKNOWN = 0

    # Person
    PERSON = 1

    # Location
    LOCATION = 2

    # Organization
    ORGANIZATION = 3

    # Event
    EVENT = 4

    # Work of art
    WORK_OF_ART = 5

    # Consumer goods
    CONSUMER_GOOD = 6

    # Other types
    OTHER = 7
  end
end

#metadataHash{String => String}

Returns Metadata associated with the entity.

Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively.

Returns:

  • (Hash{String => String})

    Metadata associated with the entity.

    Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if available. The associated keys are "wikipedia_url" and "mid", respectively.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 114

class Entity
  # The type of the entity.
  module Type
    # Unknown
    UNKNOWN = 0

    # Person
    PERSON = 1

    # Location
    LOCATION = 2

    # Organization
    ORGANIZATION = 3

    # Event
    EVENT = 4

    # Work of art
    WORK_OF_ART = 5

    # Consumer goods
    CONSUMER_GOOD = 6

    # Other types
    OTHER = 7
  end
end

#nameString

Returns The representative name for the entity.

Returns:

  • (String)

    The representative name for the entity.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 114

class Entity
  # The type of the entity.
  module Type
    # Unknown
    UNKNOWN = 0

    # Person
    PERSON = 1

    # Location
    LOCATION = 2

    # Organization
    ORGANIZATION = 3

    # Event
    EVENT = 4

    # Work of art
    WORK_OF_ART = 5

    # Consumer goods
    CONSUMER_GOOD = 6

    # Other types
    OTHER = 7
  end
end

#salienceFloat

Returns The salience score associated with the entity in the [0, 1.0] range.

The salience score for an entity provides information about the importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.

Returns:

  • (Float)

    The salience score associated with the entity in the [0, 1.0] range.

    The salience score for an entity provides information about the importance or centrality of that entity to the entire document text. Scores closer to 0 are less salient, while scores closer to 1.0 are highly salient.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 114

class Entity
  # The type of the entity.
  module Type
    # Unknown
    UNKNOWN = 0

    # Person
    PERSON = 1

    # Location
    LOCATION = 2

    # Organization
    ORGANIZATION = 3

    # Event
    EVENT = 4

    # Work of art
    WORK_OF_ART = 5

    # Consumer goods
    CONSUMER_GOOD = 6

    # Other types
    OTHER = 7
  end
end

#sentimentGoogle::Cloud::Language::V1::Sentiment

Returns For calls to AnalyzeEntitySentiment or if AnnotateTextRequest::Features#extract_entity_sentiment is set to true, this field will contain the aggregate sentiment expressed for this entity in the provided document.

Returns:



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 114

class Entity
  # The type of the entity.
  module Type
    # Unknown
    UNKNOWN = 0

    # Person
    PERSON = 1

    # Location
    LOCATION = 2

    # Organization
    ORGANIZATION = 3

    # Event
    EVENT = 4

    # Work of art
    WORK_OF_ART = 5

    # Consumer goods
    CONSUMER_GOOD = 6

    # Other types
    OTHER = 7
  end
end

#typeGoogle::Cloud::Language::V1::Entity::Type

Returns The entity type.

Returns:



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/google/cloud/language/v1/doc/google/cloud/language/v1/language_service.rb', line 114

class Entity
  # The type of the entity.
  module Type
    # Unknown
    UNKNOWN = 0

    # Person
    PERSON = 1

    # Location
    LOCATION = 2

    # Organization
    ORGANIZATION = 3

    # Event
    EVENT = 4

    # Work of art
    WORK_OF_ART = 5

    # Consumer goods
    CONSUMER_GOOD = 6

    # Other types
    OTHER = 7
  end
end