Class: Mindee::V2::Product::Extraction::ExtractionInference

Inherits:
Mindee::V2::Parsing::BaseInference show all
Defined in:
lib/mindee/v2/product/extraction/extraction_inference.rb,
sig/mindee/v2/product/extraction/extraction_inference.rbs

Overview

Extraction inference.

Class Attribute Summary collapse

Instance Attribute Summary collapse

Attributes inherited from Mindee::V2::Parsing::BaseInference

#file, #id, #job, #model

Instance Method Summary collapse

Methods inherited from BaseProduct

_params_type

Constructor Details

#initialize(server_response) ⇒ ExtractionInference

Returns a new instance of ExtractionInference.

Parameters:

  • server_response (Hash)

    Hash representation of the JSON returned by the service.

  • (Hash[String | Symbol, untyped])


19
20
21
22
23
24
# File 'lib/mindee/v2/product/extraction/extraction_inference.rb', line 19

def initialize(server_response)
  super

  @active_options = V2::Parsing::InferenceActiveOptions.new(server_response['active_options'])
  @result = ExtractionResult.new(server_response['result'])
end

Class Attribute Details

.params_typesingleton(Params::ExtractionParameters) (readonly)

Returns the value of attribute params_type.

Returns:



6
7
8
# File 'sig/mindee/v2/product/extraction/extraction_inference.rbs', line 6

def params_type
  @params_type
end

.response_typesingleton(ExtractionResponse) (readonly)

Returns the value of attribute response_type.

Returns:



7
8
9
# File 'sig/mindee/v2/product/extraction/extraction_inference.rbs', line 7

def response_type
  @response_type
end

.slugString (readonly)

Returns the value of attribute slug.

Returns:

  • (String)


8
9
10
# File 'sig/mindee/v2/product/extraction/extraction_inference.rbs', line 8

def slug
  @slug
end

Instance Attribute Details

#active_optionsInferenceActiveOptions (readonly)

Returns Options which were activated during the inference.

Returns:

  • (InferenceActiveOptions)

    Options which were activated during the inference.



14
15
16
# File 'lib/mindee/v2/product/extraction/extraction_inference.rb', line 14

def active_options
  @active_options
end

#resultExtractionResult (readonly)

Returns Result contents.

Returns:



16
17
18
# File 'lib/mindee/v2/product/extraction/extraction_inference.rb', line 16

def result
  @result
end

Instance Method Details

#to_sString

String representation.

Returns:

  • (String)


28
29
30
31
32
33
34
35
# File 'lib/mindee/v2/product/extraction/extraction_inference.rb', line 28

def to_s
  [
    super,
    @active_options.to_s,
    @result.to_s,
    '',
  ].join("\n")
end