Class: Google::Apis::LanguageV2::Entity
- Inherits:
-
Object
- Object
- Google::Apis::LanguageV2::Entity
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/language_v2/classes.rb,
lib/google/apis/language_v2/representations.rb,
lib/google/apis/language_v2/representations.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 probability and mentions, with entities.
Instance Attribute Summary collapse
-
#mentions ⇒ Array<Google::Apis::LanguageV2::EntityMention>
The mentions of this entity in the input document.
-
#metadata ⇒ Hash<String,String>
Metadata associated with the entity.
-
#name ⇒ String
The representative name for the entity.
-
#sentiment ⇒ Google::Apis::LanguageV2::Sentiment
Represents the feeling associated with the entire text or entities in the text.
-
#type ⇒ String
The entity type.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Entity
constructor
A new instance of Entity.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Entity
Returns a new instance of Entity.
616 617 618 |
# File 'lib/google/apis/language_v2/classes.rb', line 616 def initialize(**args) update!(**args) end |
Instance Attribute Details
#mentions ⇒ Array<Google::Apis::LanguageV2::EntityMention>
The mentions of this entity in the input document. The API currently supports
proper noun mentions.
Corresponds to the JSON property mentions
593 594 595 |
# File 'lib/google/apis/language_v2/classes.rb', line 593 def mentions @mentions end |
#metadata ⇒ Hash<String,String>
Metadata associated with the entity. For the metadata associated with other
entity types, see the Type table below.
Corresponds to the JSON property metadata
599 600 601 |
# File 'lib/google/apis/language_v2/classes.rb', line 599 def @metadata end |
#name ⇒ String
The representative name for the entity.
Corresponds to the JSON property name
604 605 606 |
# File 'lib/google/apis/language_v2/classes.rb', line 604 def name @name end |
#sentiment ⇒ Google::Apis::LanguageV2::Sentiment
Represents the feeling associated with the entire text or entities in the text.
Corresponds to the JSON property sentiment
609 610 611 |
# File 'lib/google/apis/language_v2/classes.rb', line 609 def sentiment @sentiment end |
#type ⇒ String
The entity type.
Corresponds to the JSON property type
614 615 616 |
# File 'lib/google/apis/language_v2/classes.rb', line 614 def type @type end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
621 622 623 624 625 626 627 |
# File 'lib/google/apis/language_v2/classes.rb', line 621 def update!(**args) @mentions = args[:mentions] if args.key?(:mentions) @metadata = args[:metadata] if args.key?(:metadata) @name = args[:name] if args.key?(:name) @sentiment = args[:sentiment] if args.key?(:sentiment) @type = args[:type] if args.key?(:type) end |