Class OcrConfig.Builder (2.45.0)

public static final class OcrConfig.Builder extends GeneratedMessageV3.Builder<OcrConfig.Builder> implements OcrConfigOrBuilder

Config for Document OCR.

Protobuf type google.cloud.documentai.v1.OcrConfig

Implements

OcrConfigOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAdvancedOcrOptions(String value)

public OcrConfig.Builder addAdvancedOcrOptions(String value)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 5;

Parameter
NameDescription
valueString

The advancedOcrOptions to add.

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

addAdvancedOcrOptionsBytes(ByteString value)

public OcrConfig.Builder addAdvancedOcrOptionsBytes(ByteString value)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 5;

Parameter
NameDescription
valueByteString

The bytes of the advancedOcrOptions to add.

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

addAllAdvancedOcrOptions(Iterable<String> values)

public OcrConfig.Builder addAllAdvancedOcrOptions(Iterable<String> values)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 5;

Parameter
NameDescription
valuesIterable<String>

The advancedOcrOptions to add.

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public OcrConfig.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
OcrConfig.Builder
Overrides

build()

public OcrConfig build()
Returns
TypeDescription
OcrConfig

buildPartial()

public OcrConfig buildPartial()
Returns
TypeDescription
OcrConfig

clear()

public OcrConfig.Builder clear()
Returns
TypeDescription
OcrConfig.Builder
Overrides

clearAdvancedOcrOptions()

public OcrConfig.Builder clearAdvancedOcrOptions()

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 5;

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

clearComputeStyleInfo() (deprecated)

public OcrConfig.Builder clearComputeStyleInfo()

Deprecated. google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated. See google/cloud/documentai/v1/document_io.proto;l=165

Turn on font identification model and return font style information. Deprecated, use PremiumFeatures.compute_style_info instead.

bool compute_style_info = 8 [deprecated = true];

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

clearDisableCharacterBoxesDetection()

public OcrConfig.Builder clearDisableCharacterBoxesDetection()

Turn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors.

bool disable_character_boxes_detection = 10;

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

clearEnableImageQualityScores()

public OcrConfig.Builder clearEnableImageQualityScores()

Enables intelligent document quality scores after OCR. Can help with diagnosing why OCR responses are of poor quality for a given input. Adds additional latency comparable to regular OCR to the process call.

bool enable_image_quality_scores = 4;

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

clearEnableNativePdfParsing()

public OcrConfig.Builder clearEnableNativePdfParsing()

Enables special handling for PDFs with existing text information. Results in better text extraction quality in such PDF inputs.

bool enable_native_pdf_parsing = 3;

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

clearEnableSymbol()

public OcrConfig.Builder clearEnableSymbol()

Includes symbol level OCR information if set to true.

bool enable_symbol = 6;

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public OcrConfig.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
OcrConfig.Builder
Overrides

clearHints()

public OcrConfig.Builder clearHints()

Hints for the OCR model.

.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;

Returns
TypeDescription
OcrConfig.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public OcrConfig.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
OcrConfig.Builder
Overrides

clearPremiumFeatures()

public OcrConfig.Builder clearPremiumFeatures()

Configurations for premium OCR features.

.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;

Returns
TypeDescription
OcrConfig.Builder

clone()

public OcrConfig.Builder clone()
Returns
TypeDescription
OcrConfig.Builder
Overrides

getAdvancedOcrOptions(int index)

public String getAdvancedOcrOptions(int index)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 5;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The advancedOcrOptions at the given index.

getAdvancedOcrOptionsBytes(int index)

public ByteString getAdvancedOcrOptionsBytes(int index)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 5;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the advancedOcrOptions at the given index.

getAdvancedOcrOptionsCount()

public int getAdvancedOcrOptionsCount()

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 5;

Returns
TypeDescription
int

The count of advancedOcrOptions.

getAdvancedOcrOptionsList()

public ProtocolStringList getAdvancedOcrOptionsList()

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 5;

Returns
TypeDescription
ProtocolStringList

A list containing the advancedOcrOptions.

getComputeStyleInfo() (deprecated)

public boolean getComputeStyleInfo()

Deprecated. google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated. See google/cloud/documentai/v1/document_io.proto;l=165

Turn on font identification model and return font style information. Deprecated, use PremiumFeatures.compute_style_info instead.

bool compute_style_info = 8 [deprecated = true];

Returns
TypeDescription
boolean

The computeStyleInfo.

getDefaultInstanceForType()

public OcrConfig getDefaultInstanceForType()
Returns
TypeDescription
OcrConfig

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDisableCharacterBoxesDetection()

public boolean getDisableCharacterBoxesDetection()

Turn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors.

bool disable_character_boxes_detection = 10;

Returns
TypeDescription
boolean

The disableCharacterBoxesDetection.

getEnableImageQualityScores()

public boolean getEnableImageQualityScores()

Enables intelligent document quality scores after OCR. Can help with diagnosing why OCR responses are of poor quality for a given input. Adds additional latency comparable to regular OCR to the process call.

bool enable_image_quality_scores = 4;

Returns
TypeDescription
boolean

The enableImageQualityScores.

getEnableNativePdfParsing()

public boolean getEnableNativePdfParsing()

Enables special handling for PDFs with existing text information. Results in better text extraction quality in such PDF inputs.

bool enable_native_pdf_parsing = 3;

Returns
TypeDescription
boolean

The enableNativePdfParsing.

getEnableSymbol()

public boolean getEnableSymbol()

Includes symbol level OCR information if set to true.

bool enable_symbol = 6;

Returns
TypeDescription
boolean

The enableSymbol.

getHints()

public OcrConfig.Hints getHints()

Hints for the OCR model.

.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;

Returns
TypeDescription
OcrConfig.Hints

The hints.

getHintsBuilder()

public OcrConfig.Hints.Builder getHintsBuilder()

Hints for the OCR model.

.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;

Returns
TypeDescription
OcrConfig.Hints.Builder

getHintsOrBuilder()

public OcrConfig.HintsOrBuilder getHintsOrBuilder()

Hints for the OCR model.

.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;

Returns
TypeDescription
OcrConfig.HintsOrBuilder

getPremiumFeatures()

public OcrConfig.PremiumFeatures getPremiumFeatures()

Configurations for premium OCR features.

.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;

Returns
TypeDescription
OcrConfig.PremiumFeatures

The premiumFeatures.

getPremiumFeaturesBuilder()

public OcrConfig.PremiumFeatures.Builder getPremiumFeaturesBuilder()

Configurations for premium OCR features.

.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;

Returns
TypeDescription
OcrConfig.PremiumFeatures.Builder

getPremiumFeaturesOrBuilder()

public OcrConfig.PremiumFeaturesOrBuilder getPremiumFeaturesOrBuilder()

Configurations for premium OCR features.

.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;

Returns
TypeDescription
OcrConfig.PremiumFeaturesOrBuilder

hasHints()

public boolean hasHints()

Hints for the OCR model.

.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;

Returns
TypeDescription
boolean

Whether the hints field is set.

hasPremiumFeatures()

public boolean hasPremiumFeatures()

Configurations for premium OCR features.

.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;

Returns
TypeDescription
boolean

Whether the premiumFeatures field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(OcrConfig other)

public OcrConfig.Builder mergeFrom(OcrConfig other)
Parameter
NameDescription
otherOcrConfig
Returns
TypeDescription
OcrConfig.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public OcrConfig.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
OcrConfig.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public OcrConfig.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
OcrConfig.Builder
Overrides

mergeHints(OcrConfig.Hints value)

public OcrConfig.Builder mergeHints(OcrConfig.Hints value)

Hints for the OCR model.

.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;

Parameter
NameDescription
valueOcrConfig.Hints
Returns
TypeDescription
OcrConfig.Builder

mergePremiumFeatures(OcrConfig.PremiumFeatures value)

public OcrConfig.Builder mergePremiumFeatures(OcrConfig.PremiumFeatures value)

Configurations for premium OCR features.

.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;

Parameter
NameDescription
valueOcrConfig.PremiumFeatures
Returns
TypeDescription
OcrConfig.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final OcrConfig.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
OcrConfig.Builder
Overrides

setAdvancedOcrOptions(int index, String value)

public OcrConfig.Builder setAdvancedOcrOptions(int index, String value)

A list of advanced OCR options to further fine-tune OCR behavior. Current valid values are:

  • legacy_layout: a heuristics layout detection algorithm, which serves as an alternative to the current ML-based layout detection algorithm. Customers can choose the best suitable layout algorithm based on their situation.

repeated string advanced_ocr_options = 5;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The advancedOcrOptions to set.

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

setComputeStyleInfo(boolean value) (deprecated)

public OcrConfig.Builder setComputeStyleInfo(boolean value)

Deprecated. google.cloud.documentai.v1.OcrConfig.compute_style_info is deprecated. See google/cloud/documentai/v1/document_io.proto;l=165

Turn on font identification model and return font style information. Deprecated, use PremiumFeatures.compute_style_info instead.

bool compute_style_info = 8 [deprecated = true];

Parameter
NameDescription
valueboolean

The computeStyleInfo to set.

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

setDisableCharacterBoxesDetection(boolean value)

public OcrConfig.Builder setDisableCharacterBoxesDetection(boolean value)

Turn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors.

bool disable_character_boxes_detection = 10;

Parameter
NameDescription
valueboolean

The disableCharacterBoxesDetection to set.

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

setEnableImageQualityScores(boolean value)

public OcrConfig.Builder setEnableImageQualityScores(boolean value)

Enables intelligent document quality scores after OCR. Can help with diagnosing why OCR responses are of poor quality for a given input. Adds additional latency comparable to regular OCR to the process call.

bool enable_image_quality_scores = 4;

Parameter
NameDescription
valueboolean

The enableImageQualityScores to set.

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

setEnableNativePdfParsing(boolean value)

public OcrConfig.Builder setEnableNativePdfParsing(boolean value)

Enables special handling for PDFs with existing text information. Results in better text extraction quality in such PDF inputs.

bool enable_native_pdf_parsing = 3;

Parameter
NameDescription
valueboolean

The enableNativePdfParsing to set.

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

setEnableSymbol(boolean value)

public OcrConfig.Builder setEnableSymbol(boolean value)

Includes symbol level OCR information if set to true.

bool enable_symbol = 6;

Parameter
NameDescription
valueboolean

The enableSymbol to set.

Returns
TypeDescription
OcrConfig.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public OcrConfig.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
OcrConfig.Builder
Overrides

setHints(OcrConfig.Hints value)

public OcrConfig.Builder setHints(OcrConfig.Hints value)

Hints for the OCR model.

.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;

Parameter
NameDescription
valueOcrConfig.Hints
Returns
TypeDescription
OcrConfig.Builder

setHints(OcrConfig.Hints.Builder builderForValue)

public OcrConfig.Builder setHints(OcrConfig.Hints.Builder builderForValue)

Hints for the OCR model.

.google.cloud.documentai.v1.OcrConfig.Hints hints = 2;

Parameter
NameDescription
builderForValueOcrConfig.Hints.Builder
Returns
TypeDescription
OcrConfig.Builder

setPremiumFeatures(OcrConfig.PremiumFeatures value)

public OcrConfig.Builder setPremiumFeatures(OcrConfig.PremiumFeatures value)

Configurations for premium OCR features.

.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;

Parameter
NameDescription
valueOcrConfig.PremiumFeatures
Returns
TypeDescription
OcrConfig.Builder

setPremiumFeatures(OcrConfig.PremiumFeatures.Builder builderForValue)

public OcrConfig.Builder setPremiumFeatures(OcrConfig.PremiumFeatures.Builder builderForValue)

Configurations for premium OCR features.

.google.cloud.documentai.v1.OcrConfig.PremiumFeatures premium_features = 11;

Parameter
NameDescription
builderForValueOcrConfig.PremiumFeatures.Builder
Returns
TypeDescription
OcrConfig.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public OcrConfig.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
OcrConfig.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final OcrConfig.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
OcrConfig.Builder
Overrides