#[non_exhaustive]pub struct OcrConfig {
pub hints: Option<Hints>,
pub enable_native_pdf_parsing: bool,
pub enable_image_quality_scores: bool,
pub advanced_ocr_options: Vec<String>,
pub enable_symbol: bool,
pub compute_style_info: bool,
pub disable_character_boxes_detection: bool,
pub premium_features: Option<PremiumFeatures>,
/* private fields */
}Expand description
Config for Document OCR.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.hints: Option<Hints>Hints for the OCR model.
enable_native_pdf_parsing: boolEnables special handling for PDFs with existing text information. Results in better text extraction quality in such PDF inputs.
enable_image_quality_scores: boolEnables 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.
advanced_ocr_options: Vec<String>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.
enable_symbol: boolIncludes symbol level OCR information if set to true.
compute_style_info: boolTurn on font identification model and return font style information. Deprecated, use PremiumFeatures.compute_style_info instead.
disable_character_boxes_detection: boolTurn off character box detector in OCR engine. Character box detection is enabled by default in OCR 2.0 (and later) processors.
Configurations for premium OCR features.
Implementations§
Source§impl OcrConfig
impl OcrConfig
pub fn new() -> Self
Sourcepub fn set_or_clear_hints<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_hints<T>(self, v: Option<T>) -> Self
Sets or clears the value of hints.
Sourcepub fn set_enable_native_pdf_parsing<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_native_pdf_parsing<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_native_pdf_parsing.
Sourcepub fn set_enable_image_quality_scores<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_image_quality_scores<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_image_quality_scores.
Sourcepub fn set_advanced_ocr_options<T, V>(self, v: T) -> Self
pub fn set_advanced_ocr_options<T, V>(self, v: T) -> Self
Sets the value of advanced_ocr_options.
Sourcepub fn set_enable_symbol<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_symbol<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_symbol.
Sourcepub fn set_compute_style_info<T: Into<bool>>(self, v: T) -> Self
👎Deprecated
pub fn set_compute_style_info<T: Into<bool>>(self, v: T) -> Self
Sets the value of compute_style_info.
Sourcepub fn set_disable_character_boxes_detection<T: Into<bool>>(self, v: T) -> Self
pub fn set_disable_character_boxes_detection<T: Into<bool>>(self, v: T) -> Self
Sets the value of disable_character_boxes_detection.
Sets the value of premium_features.
Sets or clears the value of premium_features.