Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language: copy lintified proto files (via synth). #7468

Merged
merged 1 commit into from
Mar 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 55 additions & 26 deletions language/google/cloud/language_v1/proto/language_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,66 @@ option java_multiple_files = true;
option java_outer_classname = "LanguageServiceProto";
option java_package = "com.google.cloud.language.v1";


// Provides text analysis operations such as sentiment analysis and entity
// recognition.
service LanguageService {
// Analyzes the sentiment of the provided text.
rpc AnalyzeSentiment(AnalyzeSentimentRequest) returns (AnalyzeSentimentResponse) {
option (google.api.http) = { post: "/v1/documents:analyzeSentiment" body: "*" };
rpc AnalyzeSentiment(AnalyzeSentimentRequest)
returns (AnalyzeSentimentResponse) {
option (google.api.http) = {
post: "/v1/documents:analyzeSentiment"
body: "*"
};
}

// Finds named entities (currently proper names and common nouns) in the text
// along with entity types, salience, mentions for each entity, and
// other properties.
rpc AnalyzeEntities(AnalyzeEntitiesRequest) returns (AnalyzeEntitiesResponse) {
option (google.api.http) = { post: "/v1/documents:analyzeEntities" body: "*" };
rpc AnalyzeEntities(AnalyzeEntitiesRequest)
returns (AnalyzeEntitiesResponse) {
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: "*" };
// 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.
rpc AnalyzeSyntax(AnalyzeSyntaxRequest) returns (AnalyzeSyntaxResponse) {
option (google.api.http) = { post: "/v1/documents:analyzeSyntax" body: "*" };
option (google.api.http) = {
post: "/v1/documents:analyzeSyntax"
body: "*"
};
}

// Classifies a document into categories.
rpc ClassifyText(ClassifyTextRequest) returns (ClassifyTextResponse) {
option (google.api.http) = { post: "/v1/documents:classifyText" body: "*" };
option (google.api.http) = {
post: "/v1/documents:classifyText"
body: "*"
};
}

// A convenience method that provides all the features that analyzeSentiment,
// analyzeEntities, and analyzeSyntax provide in one call.
rpc AnnotateText(AnnotateTextRequest) returns (AnnotateTextResponse) {
option (google.api.http) = { post: "/v1/documents:annotateText" body: "*" };
option (google.api.http) = {
post: "/v1/documents:annotateText"
body: "*"
};
}
}

Expand Down Expand Up @@ -114,8 +136,8 @@ message Sentence {
TextSpan text = 1;

// For calls to [AnalyzeSentiment][] or if
// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment] is set to
// true, this field will contain the sentiment for the sentence.
// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1.AnnotateTextRequest.Features.extract_document_sentiment]
// is set to true, this field will contain the sentiment for the sentence.
Sentiment sentiment = 2;
}

Expand Down Expand Up @@ -175,9 +197,9 @@ message Entity {
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.
// [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;
}

Expand Down Expand Up @@ -828,9 +850,9 @@ message EntityMention {
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.
// [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;
}

Expand All @@ -840,7 +862,9 @@ message TextSpan {
string content = 1;

// The API calculates the beginning offset of the content in the original
// document according to the [EncodingType][google.cloud.language.v1.EncodingType] specified in the API request.
// document according to the
// [EncodingType][google.cloud.language.v1.EncodingType] specified in the API
// request.
int32 begin_offset = 2;
}

Expand Down Expand Up @@ -870,7 +894,8 @@ message AnalyzeSentimentResponse {

// 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.
// See [Document.language][google.cloud.language.v1.Document.language] field
// for more details.
string language = 2;

// The sentiment for all the sentences in the document.
Expand All @@ -893,7 +918,8 @@ message AnalyzeEntitySentimentResponse {

// 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.
// See [Document.language][google.cloud.language.v1.Document.language] field
// for more details.
string language = 2;
}

Expand All @@ -913,7 +939,8 @@ message AnalyzeEntitiesResponse {

// 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.
// See [Document.language][google.cloud.language.v1.Document.language] field
// for more details.
string language = 2;
}

Expand All @@ -936,7 +963,8 @@ message AnalyzeSyntaxResponse {

// 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.
// See [Document.language][google.cloud.language.v1.Document.language] field
// for more details.
string language = 3;
}

Expand Down Expand Up @@ -1006,7 +1034,8 @@ message AnnotateTextResponse {

// 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.
// See [Document.language][google.cloud.language.v1.Document.language] field
// for more details.
string language = 5;

// Categories identified in the input document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ def AnalyzeEntities(self, request, context):
raise NotImplementedError("Method not implemented!")

def AnalyzeEntitySentiment(self, request, context):
"""Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities] in the text and analyzes
sentiment associated with each entity and its mentions.
"""Finds entities, similar to
[AnalyzeEntities][google.cloud.language.v1.LanguageService.AnalyzeEntities]
in the text and analyzes sentiment associated with each entity and its
mentions.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
Expand Down
81 changes: 55 additions & 26 deletions language/google/cloud/language_v1beta2/proto/language_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,66 @@ option java_multiple_files = true;
option java_outer_classname = "LanguageServiceProto";
option java_package = "com.google.cloud.language.v1beta2";


// Provides text analysis operations such as sentiment analysis and entity
// recognition.
service LanguageService {
// Analyzes the sentiment of the provided text.
rpc AnalyzeSentiment(AnalyzeSentimentRequest) returns (AnalyzeSentimentResponse) {
option (google.api.http) = { post: "/v1beta2/documents:analyzeSentiment" body: "*" };
rpc AnalyzeSentiment(AnalyzeSentimentRequest)
returns (AnalyzeSentimentResponse) {
option (google.api.http) = {
post: "/v1beta2/documents:analyzeSentiment"
body: "*"
};
}

// Finds named entities (currently proper names and common nouns) in the text
// along with entity types, salience, mentions for each entity, and
// other properties.
rpc AnalyzeEntities(AnalyzeEntitiesRequest) returns (AnalyzeEntitiesResponse) {
option (google.api.http) = { post: "/v1beta2/documents:analyzeEntities" body: "*" };
rpc AnalyzeEntities(AnalyzeEntitiesRequest)
returns (AnalyzeEntitiesResponse) {
option (google.api.http) = {
post: "/v1beta2/documents:analyzeEntities"
body: "*"
};
}

// Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.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: "/v1beta2/documents:analyzeEntitySentiment" body: "*" };
// Finds entities, similar to
// [AnalyzeEntities][google.cloud.language.v1beta2.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: "/v1beta2/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.
rpc AnalyzeSyntax(AnalyzeSyntaxRequest) returns (AnalyzeSyntaxResponse) {
option (google.api.http) = { post: "/v1beta2/documents:analyzeSyntax" body: "*" };
option (google.api.http) = {
post: "/v1beta2/documents:analyzeSyntax"
body: "*"
};
}

// Classifies a document into categories.
rpc ClassifyText(ClassifyTextRequest) returns (ClassifyTextResponse) {
option (google.api.http) = { post: "/v1beta2/documents:classifyText" body: "*" };
option (google.api.http) = {
post: "/v1beta2/documents:classifyText"
body: "*"
};
}

// A convenience method that provides all syntax, sentiment, entity, and
// classification features in one call.
rpc AnnotateText(AnnotateTextRequest) returns (AnnotateTextResponse) {
option (google.api.http) = { post: "/v1beta2/documents:annotateText" body: "*" };
option (google.api.http) = {
post: "/v1beta2/documents:annotateText"
body: "*"
};
}
}

Expand Down Expand Up @@ -117,8 +139,8 @@ message Sentence {
TextSpan text = 1;

// For calls to [AnalyzeSentiment][] or if
// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment] is set to
// true, this field will contain the sentiment for the sentence.
// [AnnotateTextRequest.Features.extract_document_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_document_sentiment]
// is set to true, this field will contain the sentiment for the sentence.
Sentiment sentiment = 2;
}

Expand Down Expand Up @@ -178,9 +200,9 @@ message Entity {
repeated EntityMention mentions = 5;

// For calls to [AnalyzeEntitySentiment][] or if
// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.AnnotateTextRequest.Features.extract_entity_sentiment] is set to
// true, this field will contain the aggregate sentiment expressed for this
// entity in the provided document.
// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.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;
}

Expand Down Expand Up @@ -827,9 +849,9 @@ message EntityMention {
Type type = 2;

// For calls to [AnalyzeEntitySentiment][] or if
// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.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.
// [AnnotateTextRequest.Features.extract_entity_sentiment][google.cloud.language.v1beta2.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;
}

Expand All @@ -839,7 +861,9 @@ message TextSpan {
string content = 1;

// The API calculates the beginning offset of the content in the original
// document according to the [EncodingType][google.cloud.language.v1beta2.EncodingType] specified in the API request.
// document according to the
// [EncodingType][google.cloud.language.v1beta2.EncodingType] specified in the
// API request.
int32 begin_offset = 2;
}

Expand Down Expand Up @@ -870,7 +894,8 @@ message AnalyzeSentimentResponse {

// 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.v1beta2.Document.language] field for more details.
// See [Document.language][google.cloud.language.v1beta2.Document.language]
// field for more details.
string language = 2;

// The sentiment for all the sentences in the document.
Expand All @@ -893,7 +918,8 @@ message AnalyzeEntitySentimentResponse {

// 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.v1beta2.Document.language] field for more details.
// See [Document.language][google.cloud.language.v1beta2.Document.language]
// field for more details.
string language = 2;
}

Expand All @@ -913,7 +939,8 @@ message AnalyzeEntitiesResponse {

// 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.v1beta2.Document.language] field for more details.
// See [Document.language][google.cloud.language.v1beta2.Document.language]
// field for more details.
string language = 2;
}

Expand All @@ -936,7 +963,8 @@ message AnalyzeSyntaxResponse {

// 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.v1beta2.Document.language] field for more details.
// See [Document.language][google.cloud.language.v1beta2.Document.language]
// field for more details.
string language = 3;
}

Expand Down Expand Up @@ -1006,7 +1034,8 @@ message AnnotateTextResponse {

// 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.v1beta2.Document.language] field for more details.
// See [Document.language][google.cloud.language.v1beta2.Document.language]
// field for more details.
string language = 5;

// Categories identified in the input document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ def AnalyzeEntities(self, request, context):
raise NotImplementedError("Method not implemented!")

def AnalyzeEntitySentiment(self, request, context):
"""Finds entities, similar to [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities] in the text and analyzes
sentiment associated with each entity and its mentions.
"""Finds entities, similar to
[AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities]
in the text and analyzes sentiment associated with each entity and its
mentions.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
Expand Down
Loading