google-cloud-language-v1beta2 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/google/cloud/language/v1beta2/language_service/client.rb +94 -6
- data/lib/google/cloud/language/v1beta2/language_service/rest/client.rb +79 -6
- data/lib/google/cloud/language/v1beta2/language_service/rest/service_stub.rb +64 -6
- data/lib/google/cloud/language/v1beta2/language_service_pb.rb +26 -369
- data/lib/google/cloud/language/v1beta2/language_service_services_pb.rb +6 -2
- data/lib/google/cloud/language/v1beta2/version.rb +1 -1
- data/proto_docs/google/api/client.rb +67 -4
- data/proto_docs/google/cloud/language/v1beta2/language_service.rb +47 -17
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 524c14179d39c96b9778d2b96ee0400af15d0014a894910e59d7927c73be8ce0
|
|
4
|
+
data.tar.gz: 2dc3b4d938fbb620e5a4d579dba46c4aa5cbabe9a123603d55498902de78c00e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4c55065a890b05ee34bdde82a56278c6182e29bdc7205793bb4b1a66019f84784bf3be796d02147b9edef1466bae1db859be062aaf63ada1e539dcd07e7efce3
|
|
7
|
+
data.tar.gz: '087f445776c5f206efd86e5b0a160b524870d944ccc4b9ac0394f456d0b23940ecd687932c72b158f9249dc58a557715c6a3ad1958cbe2300538b974d2203554'
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Ruby Client for the Natural Language V1beta2 API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations, to developers.
|
|
4
4
|
|
|
5
5
|
Provides natural language understanding technologies, such as sentiment analysis, entity recognition, entity sentiment analysis, and other text annotations.
|
|
6
6
|
|
|
@@ -47,7 +47,7 @@ for general usage information.
|
|
|
47
47
|
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
|
49
49
|
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
|
50
|
-
or a [`Google::Cloud::Logging::Logger`](https://
|
|
50
|
+
or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
|
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
|
53
53
|
|
|
@@ -152,7 +152,7 @@ module Google
|
|
|
152
152
|
credentials = @config.credentials
|
|
153
153
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
|
154
154
|
# but only if the default endpoint does not have a region prefix.
|
|
155
|
-
enable_self_signed_jwt = @config.endpoint ==
|
|
155
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
|
156
156
|
!@config.endpoint.split(".").first.include?("-")
|
|
157
157
|
credentials ||= Credentials.default scope: @config.scope,
|
|
158
158
|
enable_self_signed_jwt: enable_self_signed_jwt
|
|
@@ -335,8 +335,10 @@ module Google
|
|
|
335
335
|
end
|
|
336
336
|
|
|
337
337
|
##
|
|
338
|
-
# Finds entities, similar to
|
|
339
|
-
#
|
|
338
|
+
# Finds entities, similar to
|
|
339
|
+
# {::Google::Cloud::Language::V1beta2::LanguageService::Client#analyze_entities AnalyzeEntities}
|
|
340
|
+
# in the text and analyzes sentiment associated with each entity and its
|
|
341
|
+
# mentions.
|
|
340
342
|
#
|
|
341
343
|
# @overload analyze_entity_sentiment(request, options = nil)
|
|
342
344
|
# Pass arguments to `analyze_entity_sentiment` via a request object, either of type
|
|
@@ -575,6 +577,83 @@ module Google
|
|
|
575
577
|
raise ::Google::Cloud::Error.from_error(e)
|
|
576
578
|
end
|
|
577
579
|
|
|
580
|
+
##
|
|
581
|
+
# Moderates a document for harmful and sensitive categories.
|
|
582
|
+
#
|
|
583
|
+
# @overload moderate_text(request, options = nil)
|
|
584
|
+
# Pass arguments to `moderate_text` via a request object, either of type
|
|
585
|
+
# {::Google::Cloud::Language::V1beta2::ModerateTextRequest} or an equivalent Hash.
|
|
586
|
+
#
|
|
587
|
+
# @param request [::Google::Cloud::Language::V1beta2::ModerateTextRequest, ::Hash]
|
|
588
|
+
# A request object representing the call parameters. Required. To specify no
|
|
589
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
590
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
591
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
592
|
+
#
|
|
593
|
+
# @overload moderate_text(document: nil)
|
|
594
|
+
# Pass arguments to `moderate_text` via keyword arguments. Note that at
|
|
595
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
596
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
597
|
+
#
|
|
598
|
+
# @param document [::Google::Cloud::Language::V1beta2::Document, ::Hash]
|
|
599
|
+
# Required. Input document.
|
|
600
|
+
#
|
|
601
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
602
|
+
# @yieldparam response [::Google::Cloud::Language::V1beta2::ModerateTextResponse]
|
|
603
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
604
|
+
#
|
|
605
|
+
# @return [::Google::Cloud::Language::V1beta2::ModerateTextResponse]
|
|
606
|
+
#
|
|
607
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
608
|
+
#
|
|
609
|
+
# @example Basic example
|
|
610
|
+
# require "google/cloud/language/v1beta2"
|
|
611
|
+
#
|
|
612
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
613
|
+
# client = Google::Cloud::Language::V1beta2::LanguageService::Client.new
|
|
614
|
+
#
|
|
615
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
616
|
+
# request = Google::Cloud::Language::V1beta2::ModerateTextRequest.new
|
|
617
|
+
#
|
|
618
|
+
# # Call the moderate_text method.
|
|
619
|
+
# result = client.moderate_text request
|
|
620
|
+
#
|
|
621
|
+
# # The returned object is of type Google::Cloud::Language::V1beta2::ModerateTextResponse.
|
|
622
|
+
# p result
|
|
623
|
+
#
|
|
624
|
+
def moderate_text request, options = nil
|
|
625
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
626
|
+
|
|
627
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V1beta2::ModerateTextRequest
|
|
628
|
+
|
|
629
|
+
# Converts hash and nil to an options object
|
|
630
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
631
|
+
|
|
632
|
+
# Customize the options with defaults
|
|
633
|
+
metadata = @config.rpcs.moderate_text.metadata.to_h
|
|
634
|
+
|
|
635
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
|
636
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
637
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
638
|
+
gapic_version: ::Google::Cloud::Language::V1beta2::VERSION
|
|
639
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
640
|
+
|
|
641
|
+
options.apply_defaults timeout: @config.rpcs.moderate_text.timeout,
|
|
642
|
+
metadata: metadata,
|
|
643
|
+
retry_policy: @config.rpcs.moderate_text.retry_policy
|
|
644
|
+
|
|
645
|
+
options.apply_defaults timeout: @config.timeout,
|
|
646
|
+
metadata: @config.metadata,
|
|
647
|
+
retry_policy: @config.retry_policy
|
|
648
|
+
|
|
649
|
+
@language_service_stub.call_rpc :moderate_text, request, options: options do |response, operation|
|
|
650
|
+
yield response, operation if block_given?
|
|
651
|
+
return response
|
|
652
|
+
end
|
|
653
|
+
rescue ::GRPC::BadStatus => e
|
|
654
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
655
|
+
end
|
|
656
|
+
|
|
578
657
|
##
|
|
579
658
|
# A convenience method that provides all syntax, sentiment, entity, and
|
|
580
659
|
# classification features in one call.
|
|
@@ -695,9 +774,9 @@ module Google
|
|
|
695
774
|
# * (`String`) The path to a service account key file in JSON format
|
|
696
775
|
# * (`Hash`) A service account key as a Hash
|
|
697
776
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
|
698
|
-
# (see the [googleauth docs](https://
|
|
777
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
|
699
778
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
|
700
|
-
# (see the [signet docs](https://
|
|
779
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
|
701
780
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
|
702
781
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
|
703
782
|
# * (`nil`) indicating no credentials
|
|
@@ -739,7 +818,9 @@ module Google
|
|
|
739
818
|
class Configuration
|
|
740
819
|
extend ::Gapic::Config
|
|
741
820
|
|
|
742
|
-
|
|
821
|
+
DEFAULT_ENDPOINT = "language.googleapis.com"
|
|
822
|
+
|
|
823
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
|
743
824
|
config_attr :credentials, nil do |value|
|
|
744
825
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
|
745
826
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
|
@@ -818,6 +899,11 @@ module Google
|
|
|
818
899
|
#
|
|
819
900
|
attr_reader :classify_text
|
|
820
901
|
##
|
|
902
|
+
# RPC-specific configuration for `moderate_text`
|
|
903
|
+
# @return [::Gapic::Config::Method]
|
|
904
|
+
#
|
|
905
|
+
attr_reader :moderate_text
|
|
906
|
+
##
|
|
821
907
|
# RPC-specific configuration for `annotate_text`
|
|
822
908
|
# @return [::Gapic::Config::Method]
|
|
823
909
|
#
|
|
@@ -835,6 +921,8 @@ module Google
|
|
|
835
921
|
@analyze_syntax = ::Gapic::Config::Method.new analyze_syntax_config
|
|
836
922
|
classify_text_config = parent_rpcs.classify_text if parent_rpcs.respond_to? :classify_text
|
|
837
923
|
@classify_text = ::Gapic::Config::Method.new classify_text_config
|
|
924
|
+
moderate_text_config = parent_rpcs.moderate_text if parent_rpcs.respond_to? :moderate_text
|
|
925
|
+
@moderate_text = ::Gapic::Config::Method.new moderate_text_config
|
|
838
926
|
annotate_text_config = parent_rpcs.annotate_text if parent_rpcs.respond_to? :annotate_text
|
|
839
927
|
@annotate_text = ::Gapic::Config::Method.new annotate_text_config
|
|
840
928
|
|
|
@@ -148,7 +148,7 @@ module Google
|
|
|
148
148
|
credentials = @config.credentials
|
|
149
149
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
|
150
150
|
# but only if the default endpoint does not have a region prefix.
|
|
151
|
-
enable_self_signed_jwt = @config.endpoint ==
|
|
151
|
+
enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
|
152
152
|
!@config.endpoint.split(".").first.include?("-")
|
|
153
153
|
credentials ||= Credentials.default scope: @config.scope,
|
|
154
154
|
enable_self_signed_jwt: enable_self_signed_jwt
|
|
@@ -296,8 +296,10 @@ module Google
|
|
|
296
296
|
end
|
|
297
297
|
|
|
298
298
|
##
|
|
299
|
-
# Finds entities, similar to
|
|
300
|
-
#
|
|
299
|
+
# Finds entities, similar to
|
|
300
|
+
# {::Google::Cloud::Language::V1beta2::LanguageService::Rest::Client#analyze_entities AnalyzeEntities}
|
|
301
|
+
# in the text and analyzes sentiment associated with each entity and its
|
|
302
|
+
# mentions.
|
|
301
303
|
#
|
|
302
304
|
# @overload analyze_entity_sentiment(request, options = nil)
|
|
303
305
|
# Pass arguments to `analyze_entity_sentiment` via a request object, either of type
|
|
@@ -491,6 +493,68 @@ module Google
|
|
|
491
493
|
raise ::Google::Cloud::Error.from_error(e)
|
|
492
494
|
end
|
|
493
495
|
|
|
496
|
+
##
|
|
497
|
+
# Moderates a document for harmful and sensitive categories.
|
|
498
|
+
#
|
|
499
|
+
# @overload moderate_text(request, options = nil)
|
|
500
|
+
# Pass arguments to `moderate_text` via a request object, either of type
|
|
501
|
+
# {::Google::Cloud::Language::V1beta2::ModerateTextRequest} or an equivalent Hash.
|
|
502
|
+
#
|
|
503
|
+
# @param request [::Google::Cloud::Language::V1beta2::ModerateTextRequest, ::Hash]
|
|
504
|
+
# A request object representing the call parameters. Required. To specify no
|
|
505
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
506
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
507
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
508
|
+
#
|
|
509
|
+
# @overload moderate_text(document: nil)
|
|
510
|
+
# Pass arguments to `moderate_text` via keyword arguments. Note that at
|
|
511
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
512
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
513
|
+
#
|
|
514
|
+
# @param document [::Google::Cloud::Language::V1beta2::Document, ::Hash]
|
|
515
|
+
# Required. Input document.
|
|
516
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
517
|
+
# @yieldparam result [::Google::Cloud::Language::V1beta2::ModerateTextResponse]
|
|
518
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
519
|
+
#
|
|
520
|
+
# @return [::Google::Cloud::Language::V1beta2::ModerateTextResponse]
|
|
521
|
+
#
|
|
522
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
523
|
+
def moderate_text request, options = nil
|
|
524
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
525
|
+
|
|
526
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Language::V1beta2::ModerateTextRequest
|
|
527
|
+
|
|
528
|
+
# Converts hash and nil to an options object
|
|
529
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
530
|
+
|
|
531
|
+
# Customize the options with defaults
|
|
532
|
+
call_metadata = @config.rpcs.moderate_text.metadata.to_h
|
|
533
|
+
|
|
534
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
|
535
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
536
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
537
|
+
gapic_version: ::Google::Cloud::Language::V1beta2::VERSION,
|
|
538
|
+
transports_version_send: [:rest]
|
|
539
|
+
|
|
540
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
541
|
+
|
|
542
|
+
options.apply_defaults timeout: @config.rpcs.moderate_text.timeout,
|
|
543
|
+
metadata: call_metadata,
|
|
544
|
+
retry_policy: @config.rpcs.moderate_text.retry_policy
|
|
545
|
+
|
|
546
|
+
options.apply_defaults timeout: @config.timeout,
|
|
547
|
+
metadata: @config.metadata,
|
|
548
|
+
retry_policy: @config.retry_policy
|
|
549
|
+
|
|
550
|
+
@language_service_stub.moderate_text request, options do |result, operation|
|
|
551
|
+
yield result, operation if block_given?
|
|
552
|
+
return result
|
|
553
|
+
end
|
|
554
|
+
rescue ::Gapic::Rest::Error => e
|
|
555
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
556
|
+
end
|
|
557
|
+
|
|
494
558
|
##
|
|
495
559
|
# A convenience method that provides all syntax, sentiment, entity, and
|
|
496
560
|
# classification features in one call.
|
|
@@ -596,9 +660,9 @@ module Google
|
|
|
596
660
|
# * (`String`) The path to a service account key file in JSON format
|
|
597
661
|
# * (`Hash`) A service account key as a Hash
|
|
598
662
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
|
599
|
-
# (see the [googleauth docs](https://
|
|
663
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
|
600
664
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
|
601
|
-
# (see the [signet docs](https://
|
|
665
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
|
602
666
|
# * (`nil`) indicating no credentials
|
|
603
667
|
# @return [::Object]
|
|
604
668
|
# @!attribute [rw] scope
|
|
@@ -631,7 +695,9 @@ module Google
|
|
|
631
695
|
class Configuration
|
|
632
696
|
extend ::Gapic::Config
|
|
633
697
|
|
|
634
|
-
|
|
698
|
+
DEFAULT_ENDPOINT = "language.googleapis.com"
|
|
699
|
+
|
|
700
|
+
config_attr :endpoint, DEFAULT_ENDPOINT, ::String
|
|
635
701
|
config_attr :credentials, nil do |value|
|
|
636
702
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
|
637
703
|
allowed.any? { |klass| klass === value }
|
|
@@ -707,6 +773,11 @@ module Google
|
|
|
707
773
|
#
|
|
708
774
|
attr_reader :classify_text
|
|
709
775
|
##
|
|
776
|
+
# RPC-specific configuration for `moderate_text`
|
|
777
|
+
# @return [::Gapic::Config::Method]
|
|
778
|
+
#
|
|
779
|
+
attr_reader :moderate_text
|
|
780
|
+
##
|
|
710
781
|
# RPC-specific configuration for `annotate_text`
|
|
711
782
|
# @return [::Gapic::Config::Method]
|
|
712
783
|
#
|
|
@@ -724,6 +795,8 @@ module Google
|
|
|
724
795
|
@analyze_syntax = ::Gapic::Config::Method.new analyze_syntax_config
|
|
725
796
|
classify_text_config = parent_rpcs.classify_text if parent_rpcs.respond_to? :classify_text
|
|
726
797
|
@classify_text = ::Gapic::Config::Method.new classify_text_config
|
|
798
|
+
moderate_text_config = parent_rpcs.moderate_text if parent_rpcs.respond_to? :moderate_text
|
|
799
|
+
@moderate_text = ::Gapic::Config::Method.new moderate_text_config
|
|
727
800
|
annotate_text_config = parent_rpcs.annotate_text if parent_rpcs.respond_to? :annotate_text
|
|
728
801
|
@annotate_text = ::Gapic::Config::Method.new annotate_text_config
|
|
729
802
|
|
|
@@ -59,7 +59,7 @@ module Google
|
|
|
59
59
|
|
|
60
60
|
verb, uri, query_string_params, body = ServiceStub.transcode_analyze_sentiment_request request_pb
|
|
61
61
|
query_string_params = if query_string_params.any?
|
|
62
|
-
query_string_params.to_h { |p| p.split
|
|
62
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
63
63
|
else
|
|
64
64
|
{}
|
|
65
65
|
end
|
|
@@ -97,7 +97,7 @@ module Google
|
|
|
97
97
|
|
|
98
98
|
verb, uri, query_string_params, body = ServiceStub.transcode_analyze_entities_request request_pb
|
|
99
99
|
query_string_params = if query_string_params.any?
|
|
100
|
-
query_string_params.to_h { |p| p.split
|
|
100
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
101
101
|
else
|
|
102
102
|
{}
|
|
103
103
|
end
|
|
@@ -135,7 +135,7 @@ module Google
|
|
|
135
135
|
|
|
136
136
|
verb, uri, query_string_params, body = ServiceStub.transcode_analyze_entity_sentiment_request request_pb
|
|
137
137
|
query_string_params = if query_string_params.any?
|
|
138
|
-
query_string_params.to_h { |p| p.split
|
|
138
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
139
139
|
else
|
|
140
140
|
{}
|
|
141
141
|
end
|
|
@@ -173,7 +173,7 @@ module Google
|
|
|
173
173
|
|
|
174
174
|
verb, uri, query_string_params, body = ServiceStub.transcode_analyze_syntax_request request_pb
|
|
175
175
|
query_string_params = if query_string_params.any?
|
|
176
|
-
query_string_params.to_h { |p| p.split
|
|
176
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
177
177
|
else
|
|
178
178
|
{}
|
|
179
179
|
end
|
|
@@ -211,7 +211,7 @@ module Google
|
|
|
211
211
|
|
|
212
212
|
verb, uri, query_string_params, body = ServiceStub.transcode_classify_text_request request_pb
|
|
213
213
|
query_string_params = if query_string_params.any?
|
|
214
|
-
query_string_params.to_h { |p| p.split
|
|
214
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
215
215
|
else
|
|
216
216
|
{}
|
|
217
217
|
end
|
|
@@ -230,6 +230,44 @@ module Google
|
|
|
230
230
|
result
|
|
231
231
|
end
|
|
232
232
|
|
|
233
|
+
##
|
|
234
|
+
# Baseline implementation for the moderate_text REST call
|
|
235
|
+
#
|
|
236
|
+
# @param request_pb [::Google::Cloud::Language::V1beta2::ModerateTextRequest]
|
|
237
|
+
# A request object representing the call parameters. Required.
|
|
238
|
+
# @param options [::Gapic::CallOptions]
|
|
239
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
240
|
+
#
|
|
241
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
242
|
+
# @yieldparam result [::Google::Cloud::Language::V1beta2::ModerateTextResponse]
|
|
243
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
244
|
+
#
|
|
245
|
+
# @return [::Google::Cloud::Language::V1beta2::ModerateTextResponse]
|
|
246
|
+
# A result object deserialized from the server's reply
|
|
247
|
+
def moderate_text request_pb, options = nil
|
|
248
|
+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
|
249
|
+
|
|
250
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_moderate_text_request request_pb
|
|
251
|
+
query_string_params = if query_string_params.any?
|
|
252
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
253
|
+
else
|
|
254
|
+
{}
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
response = @client_stub.make_http_request(
|
|
258
|
+
verb,
|
|
259
|
+
uri: uri,
|
|
260
|
+
body: body || "",
|
|
261
|
+
params: query_string_params,
|
|
262
|
+
options: options
|
|
263
|
+
)
|
|
264
|
+
operation = ::Gapic::Rest::TransportOperation.new response
|
|
265
|
+
result = ::Google::Cloud::Language::V1beta2::ModerateTextResponse.decode_json response.body, ignore_unknown_fields: true
|
|
266
|
+
|
|
267
|
+
yield result, operation if block_given?
|
|
268
|
+
result
|
|
269
|
+
end
|
|
270
|
+
|
|
233
271
|
##
|
|
234
272
|
# Baseline implementation for the annotate_text REST call
|
|
235
273
|
#
|
|
@@ -249,7 +287,7 @@ module Google
|
|
|
249
287
|
|
|
250
288
|
verb, uri, query_string_params, body = ServiceStub.transcode_annotate_text_request request_pb
|
|
251
289
|
query_string_params = if query_string_params.any?
|
|
252
|
-
query_string_params.to_h { |p| p.split
|
|
290
|
+
query_string_params.to_h { |p| p.split "=", 2 }
|
|
253
291
|
else
|
|
254
292
|
{}
|
|
255
293
|
end
|
|
@@ -368,6 +406,26 @@ module Google
|
|
|
368
406
|
transcoder.transcode request_pb
|
|
369
407
|
end
|
|
370
408
|
|
|
409
|
+
##
|
|
410
|
+
# @private
|
|
411
|
+
#
|
|
412
|
+
# GRPC transcoding helper method for the moderate_text REST call
|
|
413
|
+
#
|
|
414
|
+
# @param request_pb [::Google::Cloud::Language::V1beta2::ModerateTextRequest]
|
|
415
|
+
# A request object representing the call parameters. Required.
|
|
416
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
|
417
|
+
# Uri, Body, Query string parameters
|
|
418
|
+
def self.transcode_moderate_text_request request_pb
|
|
419
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
|
420
|
+
.with_bindings(
|
|
421
|
+
uri_method: :post,
|
|
422
|
+
uri_template: "/v1beta2/documents:moderateText",
|
|
423
|
+
body: "*",
|
|
424
|
+
matches: []
|
|
425
|
+
)
|
|
426
|
+
transcoder.transcode request_pb
|
|
427
|
+
end
|
|
428
|
+
|
|
371
429
|
##
|
|
372
430
|
# @private
|
|
373
431
|
#
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
3
|
# source: google/cloud/language/v1beta2/language_service.proto
|
|
3
4
|
|
|
@@ -7,377 +8,31 @@ require 'google/api/annotations_pb'
|
|
|
7
8
|
require 'google/api/client_pb'
|
|
8
9
|
require 'google/api/field_behavior_pb'
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
add_file("google/cloud/language/v1beta2/language_service.proto", :syntax => :proto3) do
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
end
|
|
32
|
-
add_message "google.cloud.language.v1beta2.Sentence" do
|
|
33
|
-
optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
|
|
34
|
-
optional :sentiment, :message, 2, "google.cloud.language.v1beta2.Sentiment"
|
|
35
|
-
end
|
|
36
|
-
add_message "google.cloud.language.v1beta2.Entity" do
|
|
37
|
-
optional :name, :string, 1
|
|
38
|
-
optional :type, :enum, 2, "google.cloud.language.v1beta2.Entity.Type"
|
|
39
|
-
map :metadata, :string, :string, 3
|
|
40
|
-
optional :salience, :float, 4
|
|
41
|
-
repeated :mentions, :message, 5, "google.cloud.language.v1beta2.EntityMention"
|
|
42
|
-
optional :sentiment, :message, 6, "google.cloud.language.v1beta2.Sentiment"
|
|
43
|
-
end
|
|
44
|
-
add_enum "google.cloud.language.v1beta2.Entity.Type" do
|
|
45
|
-
value :UNKNOWN, 0
|
|
46
|
-
value :PERSON, 1
|
|
47
|
-
value :LOCATION, 2
|
|
48
|
-
value :ORGANIZATION, 3
|
|
49
|
-
value :EVENT, 4
|
|
50
|
-
value :WORK_OF_ART, 5
|
|
51
|
-
value :CONSUMER_GOOD, 6
|
|
52
|
-
value :OTHER, 7
|
|
53
|
-
value :PHONE_NUMBER, 9
|
|
54
|
-
value :ADDRESS, 10
|
|
55
|
-
value :DATE, 11
|
|
56
|
-
value :NUMBER, 12
|
|
57
|
-
value :PRICE, 13
|
|
58
|
-
end
|
|
59
|
-
add_message "google.cloud.language.v1beta2.Token" do
|
|
60
|
-
optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
|
|
61
|
-
optional :part_of_speech, :message, 2, "google.cloud.language.v1beta2.PartOfSpeech"
|
|
62
|
-
optional :dependency_edge, :message, 3, "google.cloud.language.v1beta2.DependencyEdge"
|
|
63
|
-
optional :lemma, :string, 4
|
|
64
|
-
end
|
|
65
|
-
add_message "google.cloud.language.v1beta2.Sentiment" do
|
|
66
|
-
optional :magnitude, :float, 2
|
|
67
|
-
optional :score, :float, 3
|
|
68
|
-
end
|
|
69
|
-
add_message "google.cloud.language.v1beta2.PartOfSpeech" do
|
|
70
|
-
optional :tag, :enum, 1, "google.cloud.language.v1beta2.PartOfSpeech.Tag"
|
|
71
|
-
optional :aspect, :enum, 2, "google.cloud.language.v1beta2.PartOfSpeech.Aspect"
|
|
72
|
-
optional :case, :enum, 3, "google.cloud.language.v1beta2.PartOfSpeech.Case"
|
|
73
|
-
optional :form, :enum, 4, "google.cloud.language.v1beta2.PartOfSpeech.Form"
|
|
74
|
-
optional :gender, :enum, 5, "google.cloud.language.v1beta2.PartOfSpeech.Gender"
|
|
75
|
-
optional :mood, :enum, 6, "google.cloud.language.v1beta2.PartOfSpeech.Mood"
|
|
76
|
-
optional :number, :enum, 7, "google.cloud.language.v1beta2.PartOfSpeech.Number"
|
|
77
|
-
optional :person, :enum, 8, "google.cloud.language.v1beta2.PartOfSpeech.Person"
|
|
78
|
-
optional :proper, :enum, 9, "google.cloud.language.v1beta2.PartOfSpeech.Proper"
|
|
79
|
-
optional :reciprocity, :enum, 10, "google.cloud.language.v1beta2.PartOfSpeech.Reciprocity"
|
|
80
|
-
optional :tense, :enum, 11, "google.cloud.language.v1beta2.PartOfSpeech.Tense"
|
|
81
|
-
optional :voice, :enum, 12, "google.cloud.language.v1beta2.PartOfSpeech.Voice"
|
|
82
|
-
end
|
|
83
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Tag" do
|
|
84
|
-
value :UNKNOWN, 0
|
|
85
|
-
value :ADJ, 1
|
|
86
|
-
value :ADP, 2
|
|
87
|
-
value :ADV, 3
|
|
88
|
-
value :CONJ, 4
|
|
89
|
-
value :DET, 5
|
|
90
|
-
value :NOUN, 6
|
|
91
|
-
value :NUM, 7
|
|
92
|
-
value :PRON, 8
|
|
93
|
-
value :PRT, 9
|
|
94
|
-
value :PUNCT, 10
|
|
95
|
-
value :VERB, 11
|
|
96
|
-
value :X, 12
|
|
97
|
-
value :AFFIX, 13
|
|
98
|
-
end
|
|
99
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Aspect" do
|
|
100
|
-
value :ASPECT_UNKNOWN, 0
|
|
101
|
-
value :PERFECTIVE, 1
|
|
102
|
-
value :IMPERFECTIVE, 2
|
|
103
|
-
value :PROGRESSIVE, 3
|
|
104
|
-
end
|
|
105
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Case" do
|
|
106
|
-
value :CASE_UNKNOWN, 0
|
|
107
|
-
value :ACCUSATIVE, 1
|
|
108
|
-
value :ADVERBIAL, 2
|
|
109
|
-
value :COMPLEMENTIVE, 3
|
|
110
|
-
value :DATIVE, 4
|
|
111
|
-
value :GENITIVE, 5
|
|
112
|
-
value :INSTRUMENTAL, 6
|
|
113
|
-
value :LOCATIVE, 7
|
|
114
|
-
value :NOMINATIVE, 8
|
|
115
|
-
value :OBLIQUE, 9
|
|
116
|
-
value :PARTITIVE, 10
|
|
117
|
-
value :PREPOSITIONAL, 11
|
|
118
|
-
value :REFLEXIVE_CASE, 12
|
|
119
|
-
value :RELATIVE_CASE, 13
|
|
120
|
-
value :VOCATIVE, 14
|
|
121
|
-
end
|
|
122
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Form" do
|
|
123
|
-
value :FORM_UNKNOWN, 0
|
|
124
|
-
value :ADNOMIAL, 1
|
|
125
|
-
value :AUXILIARY, 2
|
|
126
|
-
value :COMPLEMENTIZER, 3
|
|
127
|
-
value :FINAL_ENDING, 4
|
|
128
|
-
value :GERUND, 5
|
|
129
|
-
value :REALIS, 6
|
|
130
|
-
value :IRREALIS, 7
|
|
131
|
-
value :SHORT, 8
|
|
132
|
-
value :LONG, 9
|
|
133
|
-
value :ORDER, 10
|
|
134
|
-
value :SPECIFIC, 11
|
|
135
|
-
end
|
|
136
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Gender" do
|
|
137
|
-
value :GENDER_UNKNOWN, 0
|
|
138
|
-
value :FEMININE, 1
|
|
139
|
-
value :MASCULINE, 2
|
|
140
|
-
value :NEUTER, 3
|
|
141
|
-
end
|
|
142
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Mood" do
|
|
143
|
-
value :MOOD_UNKNOWN, 0
|
|
144
|
-
value :CONDITIONAL_MOOD, 1
|
|
145
|
-
value :IMPERATIVE, 2
|
|
146
|
-
value :INDICATIVE, 3
|
|
147
|
-
value :INTERROGATIVE, 4
|
|
148
|
-
value :JUSSIVE, 5
|
|
149
|
-
value :SUBJUNCTIVE, 6
|
|
150
|
-
end
|
|
151
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Number" do
|
|
152
|
-
value :NUMBER_UNKNOWN, 0
|
|
153
|
-
value :SINGULAR, 1
|
|
154
|
-
value :PLURAL, 2
|
|
155
|
-
value :DUAL, 3
|
|
156
|
-
end
|
|
157
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Person" do
|
|
158
|
-
value :PERSON_UNKNOWN, 0
|
|
159
|
-
value :FIRST, 1
|
|
160
|
-
value :SECOND, 2
|
|
161
|
-
value :THIRD, 3
|
|
162
|
-
value :REFLEXIVE_PERSON, 4
|
|
163
|
-
end
|
|
164
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Proper" do
|
|
165
|
-
value :PROPER_UNKNOWN, 0
|
|
166
|
-
value :PROPER, 1
|
|
167
|
-
value :NOT_PROPER, 2
|
|
168
|
-
end
|
|
169
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Reciprocity" do
|
|
170
|
-
value :RECIPROCITY_UNKNOWN, 0
|
|
171
|
-
value :RECIPROCAL, 1
|
|
172
|
-
value :NON_RECIPROCAL, 2
|
|
173
|
-
end
|
|
174
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Tense" do
|
|
175
|
-
value :TENSE_UNKNOWN, 0
|
|
176
|
-
value :CONDITIONAL_TENSE, 1
|
|
177
|
-
value :FUTURE, 2
|
|
178
|
-
value :PAST, 3
|
|
179
|
-
value :PRESENT, 4
|
|
180
|
-
value :IMPERFECT, 5
|
|
181
|
-
value :PLUPERFECT, 6
|
|
182
|
-
end
|
|
183
|
-
add_enum "google.cloud.language.v1beta2.PartOfSpeech.Voice" do
|
|
184
|
-
value :VOICE_UNKNOWN, 0
|
|
185
|
-
value :ACTIVE, 1
|
|
186
|
-
value :CAUSATIVE, 2
|
|
187
|
-
value :PASSIVE, 3
|
|
188
|
-
end
|
|
189
|
-
add_message "google.cloud.language.v1beta2.DependencyEdge" do
|
|
190
|
-
optional :head_token_index, :int32, 1
|
|
191
|
-
optional :label, :enum, 2, "google.cloud.language.v1beta2.DependencyEdge.Label"
|
|
192
|
-
end
|
|
193
|
-
add_enum "google.cloud.language.v1beta2.DependencyEdge.Label" do
|
|
194
|
-
value :UNKNOWN, 0
|
|
195
|
-
value :ABBREV, 1
|
|
196
|
-
value :ACOMP, 2
|
|
197
|
-
value :ADVCL, 3
|
|
198
|
-
value :ADVMOD, 4
|
|
199
|
-
value :AMOD, 5
|
|
200
|
-
value :APPOS, 6
|
|
201
|
-
value :ATTR, 7
|
|
202
|
-
value :AUX, 8
|
|
203
|
-
value :AUXPASS, 9
|
|
204
|
-
value :CC, 10
|
|
205
|
-
value :CCOMP, 11
|
|
206
|
-
value :CONJ, 12
|
|
207
|
-
value :CSUBJ, 13
|
|
208
|
-
value :CSUBJPASS, 14
|
|
209
|
-
value :DEP, 15
|
|
210
|
-
value :DET, 16
|
|
211
|
-
value :DISCOURSE, 17
|
|
212
|
-
value :DOBJ, 18
|
|
213
|
-
value :EXPL, 19
|
|
214
|
-
value :GOESWITH, 20
|
|
215
|
-
value :IOBJ, 21
|
|
216
|
-
value :MARK, 22
|
|
217
|
-
value :MWE, 23
|
|
218
|
-
value :MWV, 24
|
|
219
|
-
value :NEG, 25
|
|
220
|
-
value :NN, 26
|
|
221
|
-
value :NPADVMOD, 27
|
|
222
|
-
value :NSUBJ, 28
|
|
223
|
-
value :NSUBJPASS, 29
|
|
224
|
-
value :NUM, 30
|
|
225
|
-
value :NUMBER, 31
|
|
226
|
-
value :P, 32
|
|
227
|
-
value :PARATAXIS, 33
|
|
228
|
-
value :PARTMOD, 34
|
|
229
|
-
value :PCOMP, 35
|
|
230
|
-
value :POBJ, 36
|
|
231
|
-
value :POSS, 37
|
|
232
|
-
value :POSTNEG, 38
|
|
233
|
-
value :PRECOMP, 39
|
|
234
|
-
value :PRECONJ, 40
|
|
235
|
-
value :PREDET, 41
|
|
236
|
-
value :PREF, 42
|
|
237
|
-
value :PREP, 43
|
|
238
|
-
value :PRONL, 44
|
|
239
|
-
value :PRT, 45
|
|
240
|
-
value :PS, 46
|
|
241
|
-
value :QUANTMOD, 47
|
|
242
|
-
value :RCMOD, 48
|
|
243
|
-
value :RCMODREL, 49
|
|
244
|
-
value :RDROP, 50
|
|
245
|
-
value :REF, 51
|
|
246
|
-
value :REMNANT, 52
|
|
247
|
-
value :REPARANDUM, 53
|
|
248
|
-
value :ROOT, 54
|
|
249
|
-
value :SNUM, 55
|
|
250
|
-
value :SUFF, 56
|
|
251
|
-
value :TMOD, 57
|
|
252
|
-
value :TOPIC, 58
|
|
253
|
-
value :VMOD, 59
|
|
254
|
-
value :VOCATIVE, 60
|
|
255
|
-
value :XCOMP, 61
|
|
256
|
-
value :SUFFIX, 62
|
|
257
|
-
value :TITLE, 63
|
|
258
|
-
value :ADVPHMOD, 64
|
|
259
|
-
value :AUXCAUS, 65
|
|
260
|
-
value :AUXVV, 66
|
|
261
|
-
value :DTMOD, 67
|
|
262
|
-
value :FOREIGN, 68
|
|
263
|
-
value :KW, 69
|
|
264
|
-
value :LIST, 70
|
|
265
|
-
value :NOMC, 71
|
|
266
|
-
value :NOMCSUBJ, 72
|
|
267
|
-
value :NOMCSUBJPASS, 73
|
|
268
|
-
value :NUMC, 74
|
|
269
|
-
value :COP, 75
|
|
270
|
-
value :DISLOCATED, 76
|
|
271
|
-
value :ASP, 77
|
|
272
|
-
value :GMOD, 78
|
|
273
|
-
value :GOBJ, 79
|
|
274
|
-
value :INFMOD, 80
|
|
275
|
-
value :MES, 81
|
|
276
|
-
value :NCOMP, 82
|
|
277
|
-
end
|
|
278
|
-
add_message "google.cloud.language.v1beta2.EntityMention" do
|
|
279
|
-
optional :text, :message, 1, "google.cloud.language.v1beta2.TextSpan"
|
|
280
|
-
optional :type, :enum, 2, "google.cloud.language.v1beta2.EntityMention.Type"
|
|
281
|
-
optional :sentiment, :message, 3, "google.cloud.language.v1beta2.Sentiment"
|
|
282
|
-
end
|
|
283
|
-
add_enum "google.cloud.language.v1beta2.EntityMention.Type" do
|
|
284
|
-
value :TYPE_UNKNOWN, 0
|
|
285
|
-
value :PROPER, 1
|
|
286
|
-
value :COMMON, 2
|
|
287
|
-
end
|
|
288
|
-
add_message "google.cloud.language.v1beta2.TextSpan" do
|
|
289
|
-
optional :content, :string, 1
|
|
290
|
-
optional :begin_offset, :int32, 2
|
|
291
|
-
end
|
|
292
|
-
add_message "google.cloud.language.v1beta2.ClassificationCategory" do
|
|
293
|
-
optional :name, :string, 1
|
|
294
|
-
optional :confidence, :float, 2
|
|
295
|
-
end
|
|
296
|
-
add_message "google.cloud.language.v1beta2.ClassificationModelOptions" do
|
|
297
|
-
oneof :model_type do
|
|
298
|
-
optional :v1_model, :message, 1, "google.cloud.language.v1beta2.ClassificationModelOptions.V1Model"
|
|
299
|
-
optional :v2_model, :message, 2, "google.cloud.language.v1beta2.ClassificationModelOptions.V2Model"
|
|
300
|
-
end
|
|
301
|
-
end
|
|
302
|
-
add_message "google.cloud.language.v1beta2.ClassificationModelOptions.V1Model" do
|
|
303
|
-
end
|
|
304
|
-
add_message "google.cloud.language.v1beta2.ClassificationModelOptions.V2Model" do
|
|
305
|
-
optional :content_categories_version, :enum, 1, "google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion"
|
|
306
|
-
end
|
|
307
|
-
add_enum "google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion" do
|
|
308
|
-
value :CONTENT_CATEGORIES_VERSION_UNSPECIFIED, 0
|
|
309
|
-
value :V1, 1
|
|
310
|
-
value :V2, 2
|
|
311
|
-
end
|
|
312
|
-
add_message "google.cloud.language.v1beta2.AnalyzeSentimentRequest" do
|
|
313
|
-
optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
|
|
314
|
-
optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
|
|
315
|
-
end
|
|
316
|
-
add_message "google.cloud.language.v1beta2.AnalyzeSentimentResponse" do
|
|
317
|
-
optional :document_sentiment, :message, 1, "google.cloud.language.v1beta2.Sentiment"
|
|
318
|
-
optional :language, :string, 2
|
|
319
|
-
repeated :sentences, :message, 3, "google.cloud.language.v1beta2.Sentence"
|
|
320
|
-
end
|
|
321
|
-
add_message "google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest" do
|
|
322
|
-
optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
|
|
323
|
-
optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
|
|
324
|
-
end
|
|
325
|
-
add_message "google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse" do
|
|
326
|
-
repeated :entities, :message, 1, "google.cloud.language.v1beta2.Entity"
|
|
327
|
-
optional :language, :string, 2
|
|
328
|
-
end
|
|
329
|
-
add_message "google.cloud.language.v1beta2.AnalyzeEntitiesRequest" do
|
|
330
|
-
optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
|
|
331
|
-
optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
|
|
332
|
-
end
|
|
333
|
-
add_message "google.cloud.language.v1beta2.AnalyzeEntitiesResponse" do
|
|
334
|
-
repeated :entities, :message, 1, "google.cloud.language.v1beta2.Entity"
|
|
335
|
-
optional :language, :string, 2
|
|
336
|
-
end
|
|
337
|
-
add_message "google.cloud.language.v1beta2.AnalyzeSyntaxRequest" do
|
|
338
|
-
optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
|
|
339
|
-
optional :encoding_type, :enum, 2, "google.cloud.language.v1beta2.EncodingType"
|
|
340
|
-
end
|
|
341
|
-
add_message "google.cloud.language.v1beta2.AnalyzeSyntaxResponse" do
|
|
342
|
-
repeated :sentences, :message, 1, "google.cloud.language.v1beta2.Sentence"
|
|
343
|
-
repeated :tokens, :message, 2, "google.cloud.language.v1beta2.Token"
|
|
344
|
-
optional :language, :string, 3
|
|
345
|
-
end
|
|
346
|
-
add_message "google.cloud.language.v1beta2.ClassifyTextRequest" do
|
|
347
|
-
optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
|
|
348
|
-
optional :classification_model_options, :message, 3, "google.cloud.language.v1beta2.ClassificationModelOptions"
|
|
349
|
-
end
|
|
350
|
-
add_message "google.cloud.language.v1beta2.ClassifyTextResponse" do
|
|
351
|
-
repeated :categories, :message, 1, "google.cloud.language.v1beta2.ClassificationCategory"
|
|
352
|
-
end
|
|
353
|
-
add_message "google.cloud.language.v1beta2.AnnotateTextRequest" do
|
|
354
|
-
optional :document, :message, 1, "google.cloud.language.v1beta2.Document"
|
|
355
|
-
optional :features, :message, 2, "google.cloud.language.v1beta2.AnnotateTextRequest.Features"
|
|
356
|
-
optional :encoding_type, :enum, 3, "google.cloud.language.v1beta2.EncodingType"
|
|
357
|
-
end
|
|
358
|
-
add_message "google.cloud.language.v1beta2.AnnotateTextRequest.Features" do
|
|
359
|
-
optional :extract_syntax, :bool, 1
|
|
360
|
-
optional :extract_entities, :bool, 2
|
|
361
|
-
optional :extract_document_sentiment, :bool, 3
|
|
362
|
-
optional :extract_entity_sentiment, :bool, 4
|
|
363
|
-
optional :classify_text, :bool, 6
|
|
364
|
-
optional :classification_model_options, :message, 10, "google.cloud.language.v1beta2.ClassificationModelOptions"
|
|
365
|
-
end
|
|
366
|
-
add_message "google.cloud.language.v1beta2.AnnotateTextResponse" do
|
|
367
|
-
repeated :sentences, :message, 1, "google.cloud.language.v1beta2.Sentence"
|
|
368
|
-
repeated :tokens, :message, 2, "google.cloud.language.v1beta2.Token"
|
|
369
|
-
repeated :entities, :message, 3, "google.cloud.language.v1beta2.Entity"
|
|
370
|
-
optional :document_sentiment, :message, 4, "google.cloud.language.v1beta2.Sentiment"
|
|
371
|
-
optional :language, :string, 5
|
|
372
|
-
repeated :categories, :message, 6, "google.cloud.language.v1beta2.ClassificationCategory"
|
|
373
|
-
end
|
|
374
|
-
add_enum "google.cloud.language.v1beta2.EncodingType" do
|
|
375
|
-
value :NONE, 0
|
|
376
|
-
value :UTF8, 1
|
|
377
|
-
value :UTF16, 2
|
|
378
|
-
value :UTF32, 3
|
|
11
|
+
|
|
12
|
+
descriptor_data = "\n4google/cloud/language/v1beta2/language_service.proto\x12\x1dgoogle.cloud.language.v1beta2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\"\xa7\x03\n\x08\x44ocument\x12:\n\x04type\x18\x01 \x01(\x0e\x32,.google.cloud.language.v1beta2.Document.Type\x12\x11\n\x07\x63ontent\x18\x02 \x01(\tH\x00\x12\x19\n\x0fgcs_content_uri\x18\x03 \x01(\tH\x00\x12\x10\n\x08language\x18\x04 \x01(\t\x12\x19\n\x11reference_web_uri\x18\x05 \x01(\t\x12Y\n\x14\x62oilerplate_handling\x18\x06 \x01(\x0e\x32;.google.cloud.language.v1beta2.Document.BoilerplateHandling\"6\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nPLAIN_TEXT\x10\x01\x12\x08\n\x04HTML\x10\x02\"g\n\x13\x42oilerplateHandling\x12$\n BOILERPLATE_HANDLING_UNSPECIFIED\x10\x00\x12\x14\n\x10SKIP_BOILERPLATE\x10\x01\x12\x14\n\x10KEEP_BOILERPLATE\x10\x02\x42\x08\n\x06source\"~\n\x08Sentence\x12\x35\n\x04text\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.TextSpan\x12;\n\tsentiment\x18\x02 \x01(\x0b\x32(.google.cloud.language.v1beta2.Sentiment\"\x93\x04\n\x06\x45ntity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x38\n\x04type\x18\x02 \x01(\x0e\x32*.google.cloud.language.v1beta2.Entity.Type\x12\x45\n\x08metadata\x18\x03 \x03(\x0b\x32\x33.google.cloud.language.v1beta2.Entity.MetadataEntry\x12\x10\n\x08salience\x18\x04 \x01(\x02\x12>\n\x08mentions\x18\x05 \x03(\x0b\x32,.google.cloud.language.v1beta2.EntityMention\x12;\n\tsentiment\x18\x06 \x01(\x0b\x32(.google.cloud.language.v1beta2.Sentiment\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xb9\x01\n\x04Type\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06PERSON\x10\x01\x12\x0c\n\x08LOCATION\x10\x02\x12\x10\n\x0cORGANIZATION\x10\x03\x12\t\n\x05\x45VENT\x10\x04\x12\x0f\n\x0bWORK_OF_ART\x10\x05\x12\x11\n\rCONSUMER_GOOD\x10\x06\x12\t\n\x05OTHER\x10\x07\x12\x10\n\x0cPHONE_NUMBER\x10\t\x12\x0b\n\x07\x41\x44\x44RESS\x10\n\x12\x08\n\x04\x44\x41TE\x10\x0b\x12\n\n\x06NUMBER\x10\x0c\x12\t\n\x05PRICE\x10\r\"\xda\x01\n\x05Token\x12\x35\n\x04text\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.TextSpan\x12\x43\n\x0epart_of_speech\x18\x02 \x01(\x0b\x32+.google.cloud.language.v1beta2.PartOfSpeech\x12\x46\n\x0f\x64\x65pendency_edge\x18\x03 \x01(\x0b\x32-.google.cloud.language.v1beta2.DependencyEdge\x12\r\n\x05lemma\x18\x04 \x01(\t\"-\n\tSentiment\x12\x11\n\tmagnitude\x18\x02 \x01(\x02\x12\r\n\x05score\x18\x03 \x01(\x02\"\xdf\x10\n\x0cPartOfSpeech\x12<\n\x03tag\x18\x01 \x01(\x0e\x32/.google.cloud.language.v1beta2.PartOfSpeech.Tag\x12\x42\n\x06\x61spect\x18\x02 \x01(\x0e\x32\x32.google.cloud.language.v1beta2.PartOfSpeech.Aspect\x12>\n\x04\x63\x61se\x18\x03 \x01(\x0e\x32\x30.google.cloud.language.v1beta2.PartOfSpeech.Case\x12>\n\x04\x66orm\x18\x04 \x01(\x0e\x32\x30.google.cloud.language.v1beta2.PartOfSpeech.Form\x12\x42\n\x06gender\x18\x05 \x01(\x0e\x32\x32.google.cloud.language.v1beta2.PartOfSpeech.Gender\x12>\n\x04mood\x18\x06 \x01(\x0e\x32\x30.google.cloud.language.v1beta2.PartOfSpeech.Mood\x12\x42\n\x06number\x18\x07 \x01(\x0e\x32\x32.google.cloud.language.v1beta2.PartOfSpeech.Number\x12\x42\n\x06person\x18\x08 \x01(\x0e\x32\x32.google.cloud.language.v1beta2.PartOfSpeech.Person\x12\x42\n\x06proper\x18\t \x01(\x0e\x32\x32.google.cloud.language.v1beta2.PartOfSpeech.Proper\x12L\n\x0breciprocity\x18\n \x01(\x0e\x32\x37.google.cloud.language.v1beta2.PartOfSpeech.Reciprocity\x12@\n\x05tense\x18\x0b \x01(\x0e\x32\x31.google.cloud.language.v1beta2.PartOfSpeech.Tense\x12@\n\x05voice\x18\x0c \x01(\x0e\x32\x31.google.cloud.language.v1beta2.PartOfSpeech.Voice\"\x8d\x01\n\x03Tag\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x07\n\x03\x41\x44J\x10\x01\x12\x07\n\x03\x41\x44P\x10\x02\x12\x07\n\x03\x41\x44V\x10\x03\x12\x08\n\x04\x43ONJ\x10\x04\x12\x07\n\x03\x44\x45T\x10\x05\x12\x08\n\x04NOUN\x10\x06\x12\x07\n\x03NUM\x10\x07\x12\x08\n\x04PRON\x10\x08\x12\x07\n\x03PRT\x10\t\x12\t\n\x05PUNCT\x10\n\x12\x08\n\x04VERB\x10\x0b\x12\x05\n\x01X\x10\x0c\x12\t\n\x05\x41\x46\x46IX\x10\r\"O\n\x06\x41spect\x12\x12\n\x0e\x41SPECT_UNKNOWN\x10\x00\x12\x0e\n\nPERFECTIVE\x10\x01\x12\x10\n\x0cIMPERFECTIVE\x10\x02\x12\x0f\n\x0bPROGRESSIVE\x10\x03\"\xf8\x01\n\x04\x43\x61se\x12\x10\n\x0c\x43\x41SE_UNKNOWN\x10\x00\x12\x0e\n\nACCUSATIVE\x10\x01\x12\r\n\tADVERBIAL\x10\x02\x12\x11\n\rCOMPLEMENTIVE\x10\x03\x12\n\n\x06\x44\x41TIVE\x10\x04\x12\x0c\n\x08GENITIVE\x10\x05\x12\x10\n\x0cINSTRUMENTAL\x10\x06\x12\x0c\n\x08LOCATIVE\x10\x07\x12\x0e\n\nNOMINATIVE\x10\x08\x12\x0b\n\x07OBLIQUE\x10\t\x12\r\n\tPARTITIVE\x10\n\x12\x11\n\rPREPOSITIONAL\x10\x0b\x12\x12\n\x0eREFLEXIVE_CASE\x10\x0c\x12\x11\n\rRELATIVE_CASE\x10\r\x12\x0c\n\x08VOCATIVE\x10\x0e\"\xaf\x01\n\x04\x46orm\x12\x10\n\x0c\x46ORM_UNKNOWN\x10\x00\x12\x0c\n\x08\x41\x44NOMIAL\x10\x01\x12\r\n\tAUXILIARY\x10\x02\x12\x12\n\x0e\x43OMPLEMENTIZER\x10\x03\x12\x10\n\x0c\x46INAL_ENDING\x10\x04\x12\n\n\x06GERUND\x10\x05\x12\n\n\x06REALIS\x10\x06\x12\x0c\n\x08IRREALIS\x10\x07\x12\t\n\x05SHORT\x10\x08\x12\x08\n\x04LONG\x10\t\x12\t\n\x05ORDER\x10\n\x12\x0c\n\x08SPECIFIC\x10\x0b\"E\n\x06Gender\x12\x12\n\x0eGENDER_UNKNOWN\x10\x00\x12\x0c\n\x08\x46\x45MININE\x10\x01\x12\r\n\tMASCULINE\x10\x02\x12\n\n\x06NEUTER\x10\x03\"\x7f\n\x04Mood\x12\x10\n\x0cMOOD_UNKNOWN\x10\x00\x12\x14\n\x10\x43ONDITIONAL_MOOD\x10\x01\x12\x0e\n\nIMPERATIVE\x10\x02\x12\x0e\n\nINDICATIVE\x10\x03\x12\x11\n\rINTERROGATIVE\x10\x04\x12\x0b\n\x07JUSSIVE\x10\x05\x12\x0f\n\x0bSUBJUNCTIVE\x10\x06\"@\n\x06Number\x12\x12\n\x0eNUMBER_UNKNOWN\x10\x00\x12\x0c\n\x08SINGULAR\x10\x01\x12\n\n\x06PLURAL\x10\x02\x12\x08\n\x04\x44UAL\x10\x03\"T\n\x06Person\x12\x12\n\x0ePERSON_UNKNOWN\x10\x00\x12\t\n\x05\x46IRST\x10\x01\x12\n\n\x06SECOND\x10\x02\x12\t\n\x05THIRD\x10\x03\x12\x14\n\x10REFLEXIVE_PERSON\x10\x04\"8\n\x06Proper\x12\x12\n\x0ePROPER_UNKNOWN\x10\x00\x12\n\n\x06PROPER\x10\x01\x12\x0e\n\nNOT_PROPER\x10\x02\"J\n\x0bReciprocity\x12\x17\n\x13RECIPROCITY_UNKNOWN\x10\x00\x12\x0e\n\nRECIPROCAL\x10\x01\x12\x12\n\x0eNON_RECIPROCAL\x10\x02\"s\n\x05Tense\x12\x11\n\rTENSE_UNKNOWN\x10\x00\x12\x15\n\x11\x43ONDITIONAL_TENSE\x10\x01\x12\n\n\x06\x46UTURE\x10\x02\x12\x08\n\x04PAST\x10\x03\x12\x0b\n\x07PRESENT\x10\x04\x12\r\n\tIMPERFECT\x10\x05\x12\x0e\n\nPLUPERFECT\x10\x06\"B\n\x05Voice\x12\x11\n\rVOICE_UNKNOWN\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\r\n\tCAUSATIVE\x10\x02\x12\x0b\n\x07PASSIVE\x10\x03\"\x9a\x08\n\x0e\x44\x65pendencyEdge\x12\x18\n\x10head_token_index\x18\x01 \x01(\x05\x12\x42\n\x05label\x18\x02 \x01(\x0e\x32\x33.google.cloud.language.v1beta2.DependencyEdge.Label\"\xa9\x07\n\x05Label\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06\x41\x42\x42REV\x10\x01\x12\t\n\x05\x41\x43OMP\x10\x02\x12\t\n\x05\x41\x44VCL\x10\x03\x12\n\n\x06\x41\x44VMOD\x10\x04\x12\x08\n\x04\x41MOD\x10\x05\x12\t\n\x05\x41PPOS\x10\x06\x12\x08\n\x04\x41TTR\x10\x07\x12\x07\n\x03\x41UX\x10\x08\x12\x0b\n\x07\x41UXPASS\x10\t\x12\x06\n\x02\x43\x43\x10\n\x12\t\n\x05\x43\x43OMP\x10\x0b\x12\x08\n\x04\x43ONJ\x10\x0c\x12\t\n\x05\x43SUBJ\x10\r\x12\r\n\tCSUBJPASS\x10\x0e\x12\x07\n\x03\x44\x45P\x10\x0f\x12\x07\n\x03\x44\x45T\x10\x10\x12\r\n\tDISCOURSE\x10\x11\x12\x08\n\x04\x44OBJ\x10\x12\x12\x08\n\x04\x45XPL\x10\x13\x12\x0c\n\x08GOESWITH\x10\x14\x12\x08\n\x04IOBJ\x10\x15\x12\x08\n\x04MARK\x10\x16\x12\x07\n\x03MWE\x10\x17\x12\x07\n\x03MWV\x10\x18\x12\x07\n\x03NEG\x10\x19\x12\x06\n\x02NN\x10\x1a\x12\x0c\n\x08NPADVMOD\x10\x1b\x12\t\n\x05NSUBJ\x10\x1c\x12\r\n\tNSUBJPASS\x10\x1d\x12\x07\n\x03NUM\x10\x1e\x12\n\n\x06NUMBER\x10\x1f\x12\x05\n\x01P\x10 \x12\r\n\tPARATAXIS\x10!\x12\x0b\n\x07PARTMOD\x10\"\x12\t\n\x05PCOMP\x10#\x12\x08\n\x04POBJ\x10$\x12\x08\n\x04POSS\x10%\x12\x0b\n\x07POSTNEG\x10&\x12\x0b\n\x07PRECOMP\x10\'\x12\x0b\n\x07PRECONJ\x10(\x12\n\n\x06PREDET\x10)\x12\x08\n\x04PREF\x10*\x12\x08\n\x04PREP\x10+\x12\t\n\x05PRONL\x10,\x12\x07\n\x03PRT\x10-\x12\x06\n\x02PS\x10.\x12\x0c\n\x08QUANTMOD\x10/\x12\t\n\x05RCMOD\x10\x30\x12\x0c\n\x08RCMODREL\x10\x31\x12\t\n\x05RDROP\x10\x32\x12\x07\n\x03REF\x10\x33\x12\x0b\n\x07REMNANT\x10\x34\x12\x0e\n\nREPARANDUM\x10\x35\x12\x08\n\x04ROOT\x10\x36\x12\x08\n\x04SNUM\x10\x37\x12\x08\n\x04SUFF\x10\x38\x12\x08\n\x04TMOD\x10\x39\x12\t\n\x05TOPIC\x10:\x12\x08\n\x04VMOD\x10;\x12\x0c\n\x08VOCATIVE\x10<\x12\t\n\x05XCOMP\x10=\x12\n\n\x06SUFFIX\x10>\x12\t\n\x05TITLE\x10?\x12\x0c\n\x08\x41\x44VPHMOD\x10@\x12\x0b\n\x07\x41UXCAUS\x10\x41\x12\t\n\x05\x41UXVV\x10\x42\x12\t\n\x05\x44TMOD\x10\x43\x12\x0b\n\x07\x46OREIGN\x10\x44\x12\x06\n\x02KW\x10\x45\x12\x08\n\x04LIST\x10\x46\x12\x08\n\x04NOMC\x10G\x12\x0c\n\x08NOMCSUBJ\x10H\x12\x10\n\x0cNOMCSUBJPASS\x10I\x12\x08\n\x04NUMC\x10J\x12\x07\n\x03\x43OP\x10K\x12\x0e\n\nDISLOCATED\x10L\x12\x07\n\x03\x41SP\x10M\x12\x08\n\x04GMOD\x10N\x12\x08\n\x04GOBJ\x10O\x12\n\n\x06INFMOD\x10P\x12\x07\n\x03MES\x10Q\x12\t\n\x05NCOMP\x10R\"\xf6\x01\n\rEntityMention\x12\x35\n\x04text\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.TextSpan\x12?\n\x04type\x18\x02 \x01(\x0e\x32\x31.google.cloud.language.v1beta2.EntityMention.Type\x12;\n\tsentiment\x18\x03 \x01(\x0b\x32(.google.cloud.language.v1beta2.Sentiment\"0\n\x04Type\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\n\n\x06PROPER\x10\x01\x12\n\n\x06\x43OMMON\x10\x02\"1\n\x08TextSpan\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x14\n\x0c\x62\x65gin_offset\x18\x02 \x01(\x05\":\n\x16\x43lassificationCategory\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\"\xc7\x03\n\x1a\x43lassificationModelOptions\x12U\n\x08v1_model\x18\x01 \x01(\x0b\x32\x41.google.cloud.language.v1beta2.ClassificationModelOptions.V1ModelH\x00\x12U\n\x08v2_model\x18\x02 \x01(\x0b\x32\x41.google.cloud.language.v1beta2.ClassificationModelOptions.V2ModelH\x00\x1a\t\n\x07V1Model\x1a\xe1\x01\n\x07V2Model\x12~\n\x1a\x63ontent_categories_version\x18\x01 \x01(\x0e\x32Z.google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion\"V\n\x18\x43ontentCategoriesVersion\x12*\n&CONTENT_CATEGORIES_VERSION_UNSPECIFIED\x10\x00\x12\x06\n\x02V1\x10\x01\x12\x06\n\x02V2\x10\x02\x42\x0c\n\nmodel_type\"\x9d\x01\n\x17\x41nalyzeSentimentRequest\x12>\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.DocumentB\x03\xe0\x41\x02\x12\x42\n\rencoding_type\x18\x02 \x01(\x0e\x32+.google.cloud.language.v1beta2.EncodingType\"\xae\x01\n\x18\x41nalyzeSentimentResponse\x12\x44\n\x12\x64ocument_sentiment\x18\x01 \x01(\x0b\x32(.google.cloud.language.v1beta2.Sentiment\x12\x10\n\x08language\x18\x02 \x01(\t\x12:\n\tsentences\x18\x03 \x03(\x0b\x32\'.google.cloud.language.v1beta2.Sentence\"\xa3\x01\n\x1d\x41nalyzeEntitySentimentRequest\x12>\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.DocumentB\x03\xe0\x41\x02\x12\x42\n\rencoding_type\x18\x02 \x01(\x0e\x32+.google.cloud.language.v1beta2.EncodingType\"k\n\x1e\x41nalyzeEntitySentimentResponse\x12\x37\n\x08\x65ntities\x18\x01 \x03(\x0b\x32%.google.cloud.language.v1beta2.Entity\x12\x10\n\x08language\x18\x02 \x01(\t\"\x9c\x01\n\x16\x41nalyzeEntitiesRequest\x12>\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.DocumentB\x03\xe0\x41\x02\x12\x42\n\rencoding_type\x18\x02 \x01(\x0e\x32+.google.cloud.language.v1beta2.EncodingType\"d\n\x17\x41nalyzeEntitiesResponse\x12\x37\n\x08\x65ntities\x18\x01 \x03(\x0b\x32%.google.cloud.language.v1beta2.Entity\x12\x10\n\x08language\x18\x02 \x01(\t\"\x9a\x01\n\x14\x41nalyzeSyntaxRequest\x12>\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.DocumentB\x03\xe0\x41\x02\x12\x42\n\rencoding_type\x18\x02 \x01(\x0e\x32+.google.cloud.language.v1beta2.EncodingType\"\x9b\x01\n\x15\x41nalyzeSyntaxResponse\x12:\n\tsentences\x18\x01 \x03(\x0b\x32\'.google.cloud.language.v1beta2.Sentence\x12\x34\n\x06tokens\x18\x02 \x03(\x0b\x32$.google.cloud.language.v1beta2.Token\x12\x10\n\x08language\x18\x03 \x01(\t\"\xb6\x01\n\x13\x43lassifyTextRequest\x12>\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.DocumentB\x03\xe0\x41\x02\x12_\n\x1c\x63lassification_model_options\x18\x03 \x01(\x0b\x32\x39.google.cloud.language.v1beta2.ClassificationModelOptions\"a\n\x14\x43lassifyTextResponse\x12I\n\ncategories\x18\x01 \x03(\x0b\x32\x35.google.cloud.language.v1beta2.ClassificationCategory\"U\n\x13ModerateTextRequest\x12>\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.DocumentB\x03\xe0\x41\x02\"l\n\x14ModerateTextResponse\x12T\n\x15moderation_categories\x18\x01 \x03(\x0b\x32\x35.google.cloud.language.v1beta2.ClassificationCategory\"\x81\x04\n\x13\x41nnotateTextRequest\x12>\n\x08\x64ocument\x18\x01 \x01(\x0b\x32\'.google.cloud.language.v1beta2.DocumentB\x03\xe0\x41\x02\x12R\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0b\x32;.google.cloud.language.v1beta2.AnnotateTextRequest.FeaturesB\x03\xe0\x41\x02\x12\x42\n\rencoding_type\x18\x03 \x01(\x0e\x32+.google.cloud.language.v1beta2.EncodingType\x1a\x91\x02\n\x08\x46\x65\x61tures\x12\x16\n\x0e\x65xtract_syntax\x18\x01 \x01(\x08\x12\x18\n\x10\x65xtract_entities\x18\x02 \x01(\x08\x12\"\n\x1a\x65xtract_document_sentiment\x18\x03 \x01(\x08\x12 \n\x18\x65xtract_entity_sentiment\x18\x04 \x01(\x08\x12\x15\n\rclassify_text\x18\x06 \x01(\x08\x12\x15\n\rmoderate_text\x18\x0b \x01(\x08\x12_\n\x1c\x63lassification_model_options\x18\n \x01(\x0b\x32\x39.google.cloud.language.v1beta2.ClassificationModelOptions\"\xba\x03\n\x14\x41nnotateTextResponse\x12:\n\tsentences\x18\x01 \x03(\x0b\x32\'.google.cloud.language.v1beta2.Sentence\x12\x34\n\x06tokens\x18\x02 \x03(\x0b\x32$.google.cloud.language.v1beta2.Token\x12\x37\n\x08\x65ntities\x18\x03 \x03(\x0b\x32%.google.cloud.language.v1beta2.Entity\x12\x44\n\x12\x64ocument_sentiment\x18\x04 \x01(\x0b\x32(.google.cloud.language.v1beta2.Sentiment\x12\x10\n\x08language\x18\x05 \x01(\t\x12I\n\ncategories\x18\x06 \x03(\x0b\x32\x35.google.cloud.language.v1beta2.ClassificationCategory\x12T\n\x15moderation_categories\x18\x08 \x03(\x0b\x32\x35.google.cloud.language.v1beta2.ClassificationCategory*8\n\x0c\x45ncodingType\x12\x08\n\x04NONE\x10\x00\x12\x08\n\x04UTF8\x10\x01\x12\t\n\x05UTF16\x10\x02\x12\t\n\x05UTF32\x10\x03\x32\xbb\x0c\n\x0fLanguageService\x12\xd7\x01\n\x10\x41nalyzeSentiment\x12\x36.google.cloud.language.v1beta2.AnalyzeSentimentRequest\x1a\x37.google.cloud.language.v1beta2.AnalyzeSentimentResponse\"R\x82\xd3\xe4\x93\x02(\"#/v1beta2/documents:analyzeSentiment:\x01*\xda\x41\x16\x64ocument,encoding_type\xda\x41\x08\x64ocument\x12\xd3\x01\n\x0f\x41nalyzeEntities\x12\x35.google.cloud.language.v1beta2.AnalyzeEntitiesRequest\x1a\x36.google.cloud.language.v1beta2.AnalyzeEntitiesResponse\"Q\x82\xd3\xe4\x93\x02\'\"\"/v1beta2/documents:analyzeEntities:\x01*\xda\x41\x16\x64ocument,encoding_type\xda\x41\x08\x64ocument\x12\xef\x01\n\x16\x41nalyzeEntitySentiment\x12<.google.cloud.language.v1beta2.AnalyzeEntitySentimentRequest\x1a=.google.cloud.language.v1beta2.AnalyzeEntitySentimentResponse\"X\x82\xd3\xe4\x93\x02.\")/v1beta2/documents:analyzeEntitySentiment:\x01*\xda\x41\x16\x64ocument,encoding_type\xda\x41\x08\x64ocument\x12\xcb\x01\n\rAnalyzeSyntax\x12\x33.google.cloud.language.v1beta2.AnalyzeSyntaxRequest\x1a\x34.google.cloud.language.v1beta2.AnalyzeSyntaxResponse\"O\x82\xd3\xe4\x93\x02%\" /v1beta2/documents:analyzeSyntax:\x01*\xda\x41\x16\x64ocument,encoding_type\xda\x41\x08\x64ocument\x12\xae\x01\n\x0c\x43lassifyText\x12\x32.google.cloud.language.v1beta2.ClassifyTextRequest\x1a\x33.google.cloud.language.v1beta2.ClassifyTextResponse\"5\x82\xd3\xe4\x93\x02$\"\x1f/v1beta2/documents:classifyText:\x01*\xda\x41\x08\x64ocument\x12\xae\x01\n\x0cModerateText\x12\x32.google.cloud.language.v1beta2.ModerateTextRequest\x1a\x33.google.cloud.language.v1beta2.ModerateTextResponse\"5\x82\xd3\xe4\x93\x02$\"\x1f/v1beta2/documents:moderateText:\x01*\xda\x41\x08\x64ocument\x12\xd9\x01\n\x0c\x41nnotateText\x12\x32.google.cloud.language.v1beta2.AnnotateTextRequest\x1a\x33.google.cloud.language.v1beta2.AnnotateTextResponse\"`\x82\xd3\xe4\x93\x02$\"\x1f/v1beta2/documents:annotateText:\x01*\xda\x41\x1f\x64ocument,features,encoding_type\xda\x41\x11\x64ocument,features\x1az\xca\x41\x17language.googleapis.com\xd2\x41]https://www.googleapis.com/auth/cloud-language,https://www.googleapis.com/auth/cloud-platformBz\n!com.google.cloud.language.v1beta2B\x14LanguageServiceProtoP\x01Z=cloud.google.com/go/language/apiv1beta2/languagepb;languagepbb\x06proto3"
|
|
13
|
+
|
|
14
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
15
|
+
|
|
16
|
+
begin
|
|
17
|
+
pool.add_serialized_file(descriptor_data)
|
|
18
|
+
rescue TypeError => e
|
|
19
|
+
# Compatibility code: will be removed in the next major version.
|
|
20
|
+
require 'google/protobuf/descriptor_pb'
|
|
21
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
|
22
|
+
parsed.clear_dependency
|
|
23
|
+
serialized = parsed.class.encode(parsed)
|
|
24
|
+
file = pool.add_serialized_file(serialized)
|
|
25
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
|
26
|
+
imports = [
|
|
27
|
+
]
|
|
28
|
+
imports.each do |type_name, expected_filename|
|
|
29
|
+
import_file = pool.lookup(type_name).file_descriptor
|
|
30
|
+
if import_file.name != expected_filename
|
|
31
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
|
379
32
|
end
|
|
380
33
|
end
|
|
34
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
|
35
|
+
warn "This will become an error in the next major version."
|
|
381
36
|
end
|
|
382
37
|
|
|
383
38
|
module Google
|
|
@@ -425,6 +80,8 @@ module Google
|
|
|
425
80
|
AnalyzeSyntaxResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnalyzeSyntaxResponse").msgclass
|
|
426
81
|
ClassifyTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassifyTextRequest").msgclass
|
|
427
82
|
ClassifyTextResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ClassifyTextResponse").msgclass
|
|
83
|
+
ModerateTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ModerateTextRequest").msgclass
|
|
84
|
+
ModerateTextResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.ModerateTextResponse").msgclass
|
|
428
85
|
AnnotateTextRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnnotateTextRequest").msgclass
|
|
429
86
|
AnnotateTextRequest::Features = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnnotateTextRequest.Features").msgclass
|
|
430
87
|
AnnotateTextResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.language.v1beta2.AnnotateTextResponse").msgclass
|
|
@@ -40,8 +40,10 @@ module Google
|
|
|
40
40
|
# along with entity types, salience, mentions for each entity, and
|
|
41
41
|
# other properties.
|
|
42
42
|
rpc :AnalyzeEntities, ::Google::Cloud::Language::V1beta2::AnalyzeEntitiesRequest, ::Google::Cloud::Language::V1beta2::AnalyzeEntitiesResponse
|
|
43
|
-
# Finds entities, similar to
|
|
44
|
-
#
|
|
43
|
+
# Finds entities, similar to
|
|
44
|
+
# [AnalyzeEntities][google.cloud.language.v1beta2.LanguageService.AnalyzeEntities]
|
|
45
|
+
# in the text and analyzes sentiment associated with each entity and its
|
|
46
|
+
# mentions.
|
|
45
47
|
rpc :AnalyzeEntitySentiment, ::Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentRequest, ::Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentResponse
|
|
46
48
|
# Analyzes the syntax of the text and provides sentence boundaries and
|
|
47
49
|
# tokenization along with part of speech tags, dependency trees, and other
|
|
@@ -49,6 +51,8 @@ module Google
|
|
|
49
51
|
rpc :AnalyzeSyntax, ::Google::Cloud::Language::V1beta2::AnalyzeSyntaxRequest, ::Google::Cloud::Language::V1beta2::AnalyzeSyntaxResponse
|
|
50
52
|
# Classifies a document into categories.
|
|
51
53
|
rpc :ClassifyText, ::Google::Cloud::Language::V1beta2::ClassifyTextRequest, ::Google::Cloud::Language::V1beta2::ClassifyTextResponse
|
|
54
|
+
# Moderates a document for harmful and sensitive categories.
|
|
55
|
+
rpc :ModerateText, ::Google::Cloud::Language::V1beta2::ModerateTextRequest, ::Google::Cloud::Language::V1beta2::ModerateTextResponse
|
|
52
56
|
# A convenience method that provides all syntax, sentiment, entity, and
|
|
53
57
|
# classification features in one call.
|
|
54
58
|
rpc :AnnotateText, ::Google::Cloud::Language::V1beta2::AnnotateTextRequest, ::Google::Cloud::Language::V1beta2::AnnotateTextResponse
|
|
@@ -35,7 +35,9 @@ module Google
|
|
|
35
35
|
# Details about how and where to publish client libraries.
|
|
36
36
|
# @!attribute [rw] version
|
|
37
37
|
# @return [::String]
|
|
38
|
-
# Version of the API to apply these settings to.
|
|
38
|
+
# Version of the API to apply these settings to. This is the full protobuf
|
|
39
|
+
# package for the API, ending in the version element.
|
|
40
|
+
# Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
|
|
39
41
|
# @!attribute [rw] launch_stage
|
|
40
42
|
# @return [::Google::Api::LaunchStage]
|
|
41
43
|
# Launch stage of this version of the API.
|
|
@@ -81,7 +83,7 @@ module Google
|
|
|
81
83
|
# long-running operation pattern.
|
|
82
84
|
# @!attribute [rw] new_issue_uri
|
|
83
85
|
# @return [::String]
|
|
84
|
-
# Link to a
|
|
86
|
+
# Link to a *public* URI where users can report issues. Example:
|
|
85
87
|
# https://issuetracker.google.com/issues/new?component=190865&template=1161103
|
|
86
88
|
# @!attribute [rw] documentation_uri
|
|
87
89
|
# @return [::String]
|
|
@@ -111,6 +113,10 @@ module Google
|
|
|
111
113
|
# Client library settings. If the same version string appears multiple
|
|
112
114
|
# times in this list, then the last one wins. Settings from earlier
|
|
113
115
|
# settings with the same version string are discarded.
|
|
116
|
+
# @!attribute [rw] proto_reference_documentation_uri
|
|
117
|
+
# @return [::String]
|
|
118
|
+
# Optional link to proto reference documentation. Example:
|
|
119
|
+
# https://cloud.google.com/pubsub/lite/docs/reference/rpc
|
|
114
120
|
class Publishing
|
|
115
121
|
include ::Google::Protobuf::MessageExts
|
|
116
122
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
@@ -203,9 +209,57 @@ module Google
|
|
|
203
209
|
# @!attribute [rw] common
|
|
204
210
|
# @return [::Google::Api::CommonLanguageSettings]
|
|
205
211
|
# Some settings.
|
|
212
|
+
# @!attribute [rw] renamed_services
|
|
213
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
|
214
|
+
# Map from original service names to renamed versions.
|
|
215
|
+
# This is used when the default generated types
|
|
216
|
+
# would cause a naming conflict. (Neither name is
|
|
217
|
+
# fully-qualified.)
|
|
218
|
+
# Example: Subscriber to SubscriberServiceApi.
|
|
219
|
+
# @!attribute [rw] renamed_resources
|
|
220
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
|
221
|
+
# Map from full resource types to the effective short name
|
|
222
|
+
# for the resource. This is used when otherwise resource
|
|
223
|
+
# named from different services would cause naming collisions.
|
|
224
|
+
# Example entry:
|
|
225
|
+
# "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
|
|
226
|
+
# @!attribute [rw] ignored_resources
|
|
227
|
+
# @return [::Array<::String>]
|
|
228
|
+
# List of full resource types to ignore during generation.
|
|
229
|
+
# This is typically used for API-specific Location resources,
|
|
230
|
+
# which should be handled by the generator as if they were actually
|
|
231
|
+
# the common Location resources.
|
|
232
|
+
# Example entry: "documentai.googleapis.com/Location"
|
|
233
|
+
# @!attribute [rw] forced_namespace_aliases
|
|
234
|
+
# @return [::Array<::String>]
|
|
235
|
+
# Namespaces which must be aliased in snippets due to
|
|
236
|
+
# a known (but non-generator-predictable) naming collision
|
|
237
|
+
# @!attribute [rw] handwritten_signatures
|
|
238
|
+
# @return [::Array<::String>]
|
|
239
|
+
# Method signatures (in the form "service.method(signature)")
|
|
240
|
+
# which are provided separately, so shouldn't be generated.
|
|
241
|
+
# Snippets *calling* these methods are still generated, however.
|
|
206
242
|
class DotnetSettings
|
|
207
243
|
include ::Google::Protobuf::MessageExts
|
|
208
244
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
245
|
+
|
|
246
|
+
# @!attribute [rw] key
|
|
247
|
+
# @return [::String]
|
|
248
|
+
# @!attribute [rw] value
|
|
249
|
+
# @return [::String]
|
|
250
|
+
class RenamedServicesEntry
|
|
251
|
+
include ::Google::Protobuf::MessageExts
|
|
252
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
# @!attribute [rw] key
|
|
256
|
+
# @return [::String]
|
|
257
|
+
# @!attribute [rw] value
|
|
258
|
+
# @return [::String]
|
|
259
|
+
class RenamedResourcesEntry
|
|
260
|
+
include ::Google::Protobuf::MessageExts
|
|
261
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
262
|
+
end
|
|
209
263
|
end
|
|
210
264
|
|
|
211
265
|
# Settings for Ruby client libraries.
|
|
@@ -240,8 +294,8 @@ module Google
|
|
|
240
294
|
# Example of a YAML configuration::
|
|
241
295
|
#
|
|
242
296
|
# publishing:
|
|
243
|
-
#
|
|
244
|
-
# - selector:
|
|
297
|
+
# method_settings:
|
|
298
|
+
# - selector: google.cloud.speech.v2.Speech.BatchRecognize
|
|
245
299
|
# long_running:
|
|
246
300
|
# initial_poll_delay:
|
|
247
301
|
# seconds: 60 # 1 minute
|
|
@@ -299,6 +353,15 @@ module Google
|
|
|
299
353
|
|
|
300
354
|
# Street View Org.
|
|
301
355
|
STREET_VIEW = 4
|
|
356
|
+
|
|
357
|
+
# Shopping Org.
|
|
358
|
+
SHOPPING = 5
|
|
359
|
+
|
|
360
|
+
# Geo Org.
|
|
361
|
+
GEO = 6
|
|
362
|
+
|
|
363
|
+
# Generative AI - https://developers.generativeai.google
|
|
364
|
+
GENERATIVE_AI = 7
|
|
302
365
|
end
|
|
303
366
|
|
|
304
367
|
# To where should client libraries be published?
|
|
@@ -92,8 +92,8 @@ module Google
|
|
|
92
92
|
# @!attribute [rw] sentiment
|
|
93
93
|
# @return [::Google::Cloud::Language::V1beta2::Sentiment]
|
|
94
94
|
# For calls to [AnalyzeSentiment][] or if
|
|
95
|
-
# {::Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest.Features.extract_document_sentiment}
|
|
96
|
-
# true, this field will contain the sentiment for the sentence.
|
|
95
|
+
# {::Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_document_sentiment AnnotateTextRequest.Features.extract_document_sentiment}
|
|
96
|
+
# is set to true, this field will contain the sentiment for the sentence.
|
|
97
97
|
class Sentence
|
|
98
98
|
include ::Google::Protobuf::MessageExts
|
|
99
99
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
@@ -130,9 +130,9 @@ module Google
|
|
|
130
130
|
# @!attribute [rw] sentiment
|
|
131
131
|
# @return [::Google::Cloud::Language::V1beta2::Sentiment]
|
|
132
132
|
# For calls to [AnalyzeEntitySentiment][] or if
|
|
133
|
-
# {::Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest.Features.extract_entity_sentiment}
|
|
134
|
-
# true, this field will contain the aggregate sentiment expressed
|
|
135
|
-
# entity in the provided document.
|
|
133
|
+
# {::Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest.Features.extract_entity_sentiment}
|
|
134
|
+
# is set to true, this field will contain the aggregate sentiment expressed
|
|
135
|
+
# for this entity in the provided document.
|
|
136
136
|
class Entity
|
|
137
137
|
include ::Google::Protobuf::MessageExts
|
|
138
138
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
@@ -871,9 +871,9 @@ module Google
|
|
|
871
871
|
# @!attribute [rw] sentiment
|
|
872
872
|
# @return [::Google::Cloud::Language::V1beta2::Sentiment]
|
|
873
873
|
# For calls to [AnalyzeEntitySentiment][] or if
|
|
874
|
-
# {::Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest.Features.extract_entity_sentiment}
|
|
875
|
-
# true, this field will contain the sentiment expressed for this
|
|
876
|
-
# the entity in the provided document.
|
|
874
|
+
# {::Google::Cloud::Language::V1beta2::AnnotateTextRequest::Features#extract_entity_sentiment AnnotateTextRequest.Features.extract_entity_sentiment}
|
|
875
|
+
# is set to true, this field will contain the sentiment expressed for this
|
|
876
|
+
# mention of the entity in the provided document.
|
|
877
877
|
class EntityMention
|
|
878
878
|
include ::Google::Protobuf::MessageExts
|
|
879
879
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
@@ -898,7 +898,9 @@ module Google
|
|
|
898
898
|
# @!attribute [rw] begin_offset
|
|
899
899
|
# @return [::Integer]
|
|
900
900
|
# The API calculates the beginning offset of the content in the original
|
|
901
|
-
# document according to the
|
|
901
|
+
# document according to the
|
|
902
|
+
# {::Google::Cloud::Language::V1beta2::EncodingType EncodingType} specified in the
|
|
903
|
+
# API request.
|
|
902
904
|
class TextSpan
|
|
903
905
|
include ::Google::Protobuf::MessageExts
|
|
904
906
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
@@ -907,8 +909,7 @@ module Google
|
|
|
907
909
|
# Represents a category returned from the text classifier.
|
|
908
910
|
# @!attribute [rw] name
|
|
909
911
|
# @return [::String]
|
|
910
|
-
# The name of the category representing the document
|
|
911
|
-
# taxonomy](https://cloud.google.com/natural-language/docs/categories).
|
|
912
|
+
# The name of the category representing the document.
|
|
912
913
|
# @!attribute [rw] confidence
|
|
913
914
|
# @return [::Float]
|
|
914
915
|
# The classifier's confidence of the category. Number represents how certain
|
|
@@ -982,7 +983,8 @@ module Google
|
|
|
982
983
|
# @return [::String]
|
|
983
984
|
# The language of the text, which will be the same as the language specified
|
|
984
985
|
# in the request or, if not specified, the automatically-detected language.
|
|
985
|
-
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
986
|
+
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
987
|
+
# field for more details.
|
|
986
988
|
# @!attribute [rw] sentences
|
|
987
989
|
# @return [::Array<::Google::Cloud::Language::V1beta2::Sentence>]
|
|
988
990
|
# The sentiment for all the sentences in the document.
|
|
@@ -1011,7 +1013,8 @@ module Google
|
|
|
1011
1013
|
# @return [::String]
|
|
1012
1014
|
# The language of the text, which will be the same as the language specified
|
|
1013
1015
|
# in the request or, if not specified, the automatically-detected language.
|
|
1014
|
-
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
1016
|
+
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
1017
|
+
# field for more details.
|
|
1015
1018
|
class AnalyzeEntitySentimentResponse
|
|
1016
1019
|
include ::Google::Protobuf::MessageExts
|
|
1017
1020
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
@@ -1037,7 +1040,8 @@ module Google
|
|
|
1037
1040
|
# @return [::String]
|
|
1038
1041
|
# The language of the text, which will be the same as the language specified
|
|
1039
1042
|
# in the request or, if not specified, the automatically-detected language.
|
|
1040
|
-
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
1043
|
+
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
1044
|
+
# field for more details.
|
|
1041
1045
|
class AnalyzeEntitiesResponse
|
|
1042
1046
|
include ::Google::Protobuf::MessageExts
|
|
1043
1047
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
@@ -1066,7 +1070,8 @@ module Google
|
|
|
1066
1070
|
# @return [::String]
|
|
1067
1071
|
# The language of the text, which will be the same as the language specified
|
|
1068
1072
|
# in the request or, if not specified, the automatically-detected language.
|
|
1069
|
-
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
1073
|
+
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
1074
|
+
# field for more details.
|
|
1070
1075
|
class AnalyzeSyntaxResponse
|
|
1071
1076
|
include ::Google::Protobuf::MessageExts
|
|
1072
1077
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
@@ -1094,6 +1099,24 @@ module Google
|
|
|
1094
1099
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
1095
1100
|
end
|
|
1096
1101
|
|
|
1102
|
+
# The document moderation request message.
|
|
1103
|
+
# @!attribute [rw] document
|
|
1104
|
+
# @return [::Google::Cloud::Language::V1beta2::Document]
|
|
1105
|
+
# Required. Input document.
|
|
1106
|
+
class ModerateTextRequest
|
|
1107
|
+
include ::Google::Protobuf::MessageExts
|
|
1108
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
1109
|
+
end
|
|
1110
|
+
|
|
1111
|
+
# The document moderation response message.
|
|
1112
|
+
# @!attribute [rw] moderation_categories
|
|
1113
|
+
# @return [::Array<::Google::Cloud::Language::V1beta2::ClassificationCategory>]
|
|
1114
|
+
# Harmful and sensitive categories representing the input document.
|
|
1115
|
+
class ModerateTextResponse
|
|
1116
|
+
include ::Google::Protobuf::MessageExts
|
|
1117
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
1118
|
+
end
|
|
1119
|
+
|
|
1097
1120
|
# The request message for the text annotation API, which can perform multiple
|
|
1098
1121
|
# analysis types (sentiment, entities, and syntax) in one call.
|
|
1099
1122
|
# @!attribute [rw] document
|
|
@@ -1111,7 +1134,7 @@ module Google
|
|
|
1111
1134
|
|
|
1112
1135
|
# All available features for sentiment, syntax, and semantic analysis.
|
|
1113
1136
|
# Setting each one to true will enable that specific analysis for the input.
|
|
1114
|
-
# Next ID:
|
|
1137
|
+
# Next ID: 12
|
|
1115
1138
|
# @!attribute [rw] extract_syntax
|
|
1116
1139
|
# @return [::Boolean]
|
|
1117
1140
|
# Extract syntax information.
|
|
@@ -1130,6 +1153,9 @@ module Google
|
|
|
1130
1153
|
# the API will use the default model which classifies into a
|
|
1131
1154
|
# [predefined
|
|
1132
1155
|
# taxonomy](https://cloud.google.com/natural-language/docs/categories).
|
|
1156
|
+
# @!attribute [rw] moderate_text
|
|
1157
|
+
# @return [::Boolean]
|
|
1158
|
+
# Moderate the document for harmful and sensitive categories.
|
|
1133
1159
|
# @!attribute [rw] classification_model_options
|
|
1134
1160
|
# @return [::Google::Cloud::Language::V1beta2::ClassificationModelOptions]
|
|
1135
1161
|
# The model options to use for classification. Defaults to v1 options
|
|
@@ -1163,10 +1189,14 @@ module Google
|
|
|
1163
1189
|
# @return [::String]
|
|
1164
1190
|
# The language of the text, which will be the same as the language specified
|
|
1165
1191
|
# in the request or, if not specified, the automatically-detected language.
|
|
1166
|
-
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
1192
|
+
# See {::Google::Cloud::Language::V1beta2::Document#language Document.language}
|
|
1193
|
+
# field for more details.
|
|
1167
1194
|
# @!attribute [rw] categories
|
|
1168
1195
|
# @return [::Array<::Google::Cloud::Language::V1beta2::ClassificationCategory>]
|
|
1169
1196
|
# Categories identified in the input document.
|
|
1197
|
+
# @!attribute [rw] moderation_categories
|
|
1198
|
+
# @return [::Array<::Google::Cloud::Language::V1beta2::ClassificationCategory>]
|
|
1199
|
+
# Harmful and sensitive categories identified in the input document.
|
|
1170
1200
|
class AnnotateTextResponse
|
|
1171
1201
|
include ::Google::Protobuf::MessageExts
|
|
1172
1202
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-cloud-language-v1beta2
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Google LLC
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: gapic-common
|
|
@@ -16,7 +16,7 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.
|
|
19
|
+
version: 0.19.1
|
|
20
20
|
- - "<"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
22
|
version: 2.a
|
|
@@ -26,7 +26,7 @@ dependencies:
|
|
|
26
26
|
requirements:
|
|
27
27
|
- - ">="
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 0.
|
|
29
|
+
version: 0.19.1
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
32
|
version: 2.a
|
|
@@ -211,5 +211,6 @@ requirements: []
|
|
|
211
211
|
rubygems_version: 3.4.2
|
|
212
212
|
signing_key:
|
|
213
213
|
specification_version: 4
|
|
214
|
-
summary:
|
|
214
|
+
summary: Provides natural language understanding technologies, such as sentiment analysis,
|
|
215
|
+
entity recognition, entity sentiment analysis, and other text annotations, to developers.
|
|
215
216
|
test_files: []
|