Class: Mindee::V2::Product::Classification::ClassificationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/v2/product/classification/classification_result.rb

Overview

Result of the document classifier inference.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_response) ⇒ ClassificationResult

Returns a new instance of ClassificationResult.

Parameters:

  • server_response (Hash)

    Hash representation of the JSON returned by the service.



15
16
17
# File 'lib/mindee/v2/product/classification/classification_result.rb', line 15

def initialize(server_response)
  @classification = ClassificationClassifier.new(server_response['classification'])
end

Instance Attribute Details

#classificationClassificationClassifier (readonly)

Returns The document type, as identified on given classification values.

Returns:



12
13
14
# File 'lib/mindee/v2/product/classification/classification_result.rb', line 12

def classification
  @classification
end

Instance Method Details

#to_sString

Returns String representation.

Returns:

  • (String)

    String representation.



20
21
22
# File 'lib/mindee/v2/product/classification/classification_result.rb', line 20

def to_s
  "Classification\n==============\n#{@classification}"
end