Synchronize new proto changes.
diff --git a/google/cloud/language/v1/language_service.proto b/google/cloud/language/v1/language_service.proto
index e8758e5..6620c2c 100644
--- a/google/cloud/language/v1/language_service.proto
+++ b/google/cloud/language/v1/language_service.proto
@@ -39,6 +39,12 @@
option (google.api.http) = { post: "/v1/documents:analyzeEntities" body: "*" };
}
+ // Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
+ // sentiment associated with each entity and its mentions.
+ rpc AnalyzeEntitySentiment(AnalyzeEntitySentimentRequest) returns (AnalyzeEntitySentimentResponse) {
+ option (google.api.http) = { post: "/v1/documents:analyzeEntitySentiment" body: "*" };
+ }
+
// Analyzes the syntax of the text and provides sentence boundaries and
// tokenization along with part of speech tags, dependency trees, and other
// properties.
@@ -89,7 +95,7 @@
// The language of the document (if not specified, the language is
// automatically detected). Both ISO and BCP-47 language codes are
// accepted.<br>
- // [Language Support](https://cloud.google.com/natural-language/docs/languages)
+ // [Language Support](/natural-language/docs/languages)
// lists currently supported languages for each API method.
// If the language (either specified by the caller or automatically detected)
// is not supported by the called API method, an `INVALID_ARGUMENT` error
@@ -162,6 +168,12 @@
// The mentions of this entity in the input document. The API currently
// supports proper noun mentions.
repeated EntityMention mentions = 5;
+
+ // For calls to [AnalyzeEntitySentiment][] or if
+ // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+ // true, this field will contain the aggregate sentiment expressed for this
+ // entity in the provided document.
+ Sentiment sentiment = 6;
}
// Represents the smallest syntactic building block of the text.
@@ -758,6 +770,24 @@
// Dislocated relation (for fronted/topicalized elements)
DISLOCATED = 76;
+
+ // Aspect marker
+ ASP = 77;
+
+ // Genitive modifier
+ GMOD = 78;
+
+ // Genitive object
+ GOBJ = 79;
+
+ // Infinitival modifier
+ INFMOD = 80;
+
+ // Measure
+ MES = 81;
+
+ // Nominal complement of a noun
+ NCOMP = 82;
}
// Represents the head of this token in the dependency tree.
@@ -791,6 +821,12 @@
// The type of the entity mention.
Type type = 2;
+
+ // For calls to [AnalyzeEntitySentiment][] or if
+ // [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
+ // true, this field will contain the sentiment expressed for this mention of
+ // the entity in the provided document.
+ Sentiment sentiment = 3;
}
// Represents an output piece of text.
@@ -826,6 +862,26 @@
repeated Sentence sentences = 3;
}
+// The entity-level sentiment analysis request message.
+message AnalyzeEntitySentimentRequest {
+ // Input document.
+ Document document = 1;
+
+ // The encoding type used by the API to calculate offsets.
+ EncodingType encoding_type = 2;
+}
+
+// The entity-level sentiment analysis response message.
+message AnalyzeEntitySentimentResponse {
+ // The recognized entities in the input document with associated sentiments.
+ repeated Entity entities = 1;
+
+ // The language of the text, which will be the same as the language specified
+ // in the request or, if not specified, the automatically-detected language.
+ // See [Document.language][google.cloud.language.v1.Document.language] field for more details.
+ string language = 2;
+}
+
// The entity analysis request message.
message AnalyzeEntitiesRequest {
// Input document.
@@ -883,6 +939,9 @@
// Extract document-level sentiment.
bool extract_document_sentiment = 3;
+
+ // Extract entities and their associated sentiment.
+ bool extract_entity_sentiment = 4;
}
// Input document.
diff --git a/google/cloud/language/v1beta2/language_service.proto b/google/cloud/language/v1beta2/language_service.proto
index 6ddea6d..54c6638 100644
--- a/google/cloud/language/v1beta2/language_service.proto
+++ b/google/cloud/language/v1beta2/language_service.proto
@@ -774,6 +774,24 @@
// Dislocated relation (for fronted/topicalized elements)
DISLOCATED = 76;
+
+ // Aspect marker
+ ASP = 77;
+
+ // Genitive modifier
+ GMOD = 78;
+
+ // Genitive object
+ GOBJ = 79;
+
+ // Infinitival modifier
+ INFMOD = 80;
+
+ // Measure
+ MES = 81;
+
+ // Nominal complement of a noun
+ NCOMP = 82;
}
// Represents the head of this token in the dependency tree.