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.
-
#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
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 234 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'], '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
265 266 267 268 269 270 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 265 def context unless @instance_context @instance_context = OperatorResultContext.new(@version , @params['transcript_sid'], @params['operator_sid']) end @instance_context end |
#extract_match ⇒ Boolean
Returns Boolean to tell if extract Language Understanding Processing model matches results.
292 293 294 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 292 def extract_match @properties['extract_match'] end |
#extract_results ⇒ Hash
Returns List of text extraction results. This might be available on classify-extract model outputs.
340 341 342 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 340 def extract_results @properties['extract_results'] end |
#fetch(redacted: :unset) ⇒ OperatorResultInstance
Fetch the OperatorResultInstance
366 367 368 369 370 371 372 373 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 366 def fetch( redacted: :unset ) context.fetch( redacted: redacted, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
384 385 386 387 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 384 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.OperatorResultInstance #{values}>" end |
#label_probabilities ⇒ Hash
Returns The labels probabilities. This might be available on conversation classify model outputs.
334 335 336 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 334 def label_probabilities @properties['label_probabilities'] end |
#match_probability ⇒ Float
Returns Percentage of ‘matching’ class needed to consider a sentence matches.
298 299 300 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 298 def match_probability @properties['match_probability'] end |
#name ⇒ String
Returns The name of the applied Language Understanding.
280 281 282 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 280 def name @properties['name'] end |
#normalized_result ⇒ String
Returns Normalized output of extraction stage which matches Label.
304 305 306 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 304 def normalized_result @properties['normalized_result'] end |
#operator_sid ⇒ String
Returns A 34 character string that identifies this Language Understanding operator sid.
286 287 288 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 286 def operator_sid @properties['operator_sid'] end |
#operator_type ⇒ OperatorType
274 275 276 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 274 def operator_type @properties['operator_type'] end |
#predicted_label ⇒ String
Returns The ‘matching’ class. This might be available on conversation classify model outputs.
322 323 324 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 322 def predicted_label @properties['predicted_label'] end |
#predicted_probability ⇒ Float
Returns Percentage of ‘matching’ class needed to consider a sentence matches.
328 329 330 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 328 def predicted_probability @properties['predicted_probability'] end |
#text_generation_results ⇒ Hash
Returns Output of a text generation operator for example Conversation Sumamary.
346 347 348 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 346 def text_generation_results @properties['text_generation_results'] end |
#to_s ⇒ Object
Provide a user friendly representation
377 378 379 380 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 377 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.OperatorResultInstance #{values}>" end |
#transcript_sid ⇒ String
Returns A 34 character string that uniquely identifies this Transcript.
352 353 354 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 352 def transcript_sid @properties['transcript_sid'] end |
#url ⇒ String
Returns The URL of this resource.
358 359 360 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 358 def url @properties['url'] end |
#utterance_match ⇒ Boolean
Returns Boolean to tell if Utterance matches results.
316 317 318 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 316 def utterance_match @properties['utterance_match'] end |
#utterance_results ⇒ Array<Hash>
Returns List of mapped utterance object which matches sentences.
310 311 312 |
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 310 def utterance_results @properties['utterance_results'] end |