Class: Twilio::REST::Intelligence::V2::TranscriptContext::OperatorResultInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Intelligence::V2::TranscriptContext::OperatorResultInstance
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb
Instance Method Summary collapse
-
#context ⇒ OperatorResultContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#extract_match ⇒ Boolean
Boolean to tell if extract Language Understanding Processing model matches results.
-
#extract_results ⇒ Hash
List of text extraction results.
-
#fetch(redacted: :unset) ⇒ OperatorResultInstance
Fetch the OperatorResultInstance.
-
#initialize(version, payload, transcript_sid: nil, operator_sid: nil) ⇒ OperatorResultInstance
constructor
Initialize the OperatorResultInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #json_results ⇒ Hash
-
#label_probabilities ⇒ Hash
The labels probabilities.
-
#match_probability ⇒ Float
Percentage of ‘matching’ class needed to consider a sentence matches.
-
#name ⇒ String
The name of the applied Language Understanding.
-
#normalized_result ⇒ String
Normalized output of extraction stage which matches Label.
-
#operator_sid ⇒ String
A 34 character string that identifies this Language Understanding operator sid.
- #operator_type ⇒ OperatorType
-
#predicted_label ⇒ String
The ‘matching’ class.
-
#predicted_probability ⇒ Float
Percentage of ‘matching’ class needed to consider a sentence matches.
-
#text_generation_results ⇒ Hash
Output of a text generation operator for example Conversation Sumamary.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#transcript_sid ⇒ String
A 34 character string that uniquely identifies this Transcript.
-
#url ⇒ String
The URL of this resource.
-
#utterance_match ⇒ Boolean
Boolean to tell if Utterance matches results.
-
#utterance_results ⇒ Array<Hash>
List of mapped utterance object which matches sentences.
Constructor Details
#initialize(version, payload, transcript_sid: nil, operator_sid: nil) ⇒ OperatorResultInstance
Initialize the OperatorResultInstance
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 400 def initialize(version, payload , transcript_sid: nil, operator_sid: nil) super(version) # Marshaled Properties @properties = { 'operator_type' => payload['operator_type'], 'name' => payload['name'], 'operator_sid' => payload['operator_sid'], 'extract_match' => payload['extract_match'], 'match_probability' => payload['match_probability'], 'normalized_result' => payload['normalized_result'], 'utterance_results' => payload['utterance_results'], 'utterance_match' => payload['utterance_match'], 'predicted_label' => payload['predicted_label'], 'predicted_probability' => payload['predicted_probability'], 'label_probabilities' => payload['label_probabilities'], 'extract_results' => payload['extract_results'], 'text_generation_results' => payload['text_generation_results'], 'json_results' => payload['json_results'], 'transcript_sid' => payload['transcript_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'transcript_sid' => transcript_sid || @properties['transcript_sid'] ,'operator_sid' => operator_sid || @properties['operator_sid'] , } end |
Instance Method Details
#context ⇒ OperatorResultContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
433 434 435 436 437 438 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 433 def context unless @instance_context @instance_context = OperatorResultContext.new(@version , @params['transcript_sid'], @params['operator_sid']) end @instance_context end |
#extract_match ⇒ Boolean
460 461 462 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 460 def extract_match @properties['extract_match'] end |
#extract_results ⇒ Hash
508 509 510 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 508 def extract_results @properties['extract_results'] end |
#fetch(redacted: :unset) ⇒ OperatorResultInstance
Fetch the OperatorResultInstance
540 541 542 543 544 545 546 547 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 540 def fetch( redacted: :unset ) context.fetch( redacted: redacted, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
558 559 560 561 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 558 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.OperatorResultInstance #{values}>" end |
#json_results ⇒ Hash
520 521 522 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 520 def json_results @properties['json_results'] end |
#label_probabilities ⇒ Hash
502 503 504 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 502 def label_probabilities @properties['label_probabilities'] end |
#match_probability ⇒ Float
466 467 468 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 466 def match_probability @properties['match_probability'] end |
#name ⇒ String
448 449 450 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 448 def name @properties['name'] end |
#normalized_result ⇒ String
472 473 474 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 472 def normalized_result @properties['normalized_result'] end |
#operator_sid ⇒ String
454 455 456 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 454 def operator_sid @properties['operator_sid'] end |
#operator_type ⇒ OperatorType
442 443 444 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 442 def operator_type @properties['operator_type'] end |
#predicted_label ⇒ String
490 491 492 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 490 def predicted_label @properties['predicted_label'] end |
#predicted_probability ⇒ Float
496 497 498 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 496 def predicted_probability @properties['predicted_probability'] end |
#text_generation_results ⇒ Hash
514 515 516 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 514 def text_generation_results @properties['text_generation_results'] end |
#to_s ⇒ Object
Provide a user friendly representation
551 552 553 554 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 551 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.OperatorResultInstance #{values}>" end |
#transcript_sid ⇒ String
526 527 528 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 526 def transcript_sid @properties['transcript_sid'] end |
#url ⇒ String
532 533 534 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 532 def url @properties['url'] end |
#utterance_match ⇒ Boolean
484 485 486 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 484 def utterance_match @properties['utterance_match'] end |
#utterance_results ⇒ Array<Hash>
478 479 480 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 478 def utterance_results @properties['utterance_results'] end |