#walkzzz/image.mbt/process/ocr

    OCR 全流程(版面分析、二值化、倾斜校正、字符分割、识别、后处理)

    #概览

    项目数量
    公开函数352
    公开类型142
    常量0
    错误类型0

    #类型

    pub(all) struct AccuracyStats {
    pub(all) struct AdaptivePreprocessConfig {
    pub(all) struct AdvancedChineseOcrConfig {
    pub(all) struct ApiServerConfig {
    pub(all) struct AugmentationConfig {
    pub(all) enum AugmentationType {
    pub(all) struct BatchOcrConfig {
    pub(all) struct BatchProgress {
    pub(all) struct BatchResultSummary {
    pub(all) struct BatchTask {
    pub(all) enum BatchTaskStatus {
    pub(all) struct CharRecognitionResult {
    pub(all) struct CharSegment {
    pub(all) struct ChineseCharInfo {
    pub(all) struct ChineseCharStructure {
    pub(all) struct ChineseOcrConfig {
    pub(all) struct ChineseRadical {
    pub(all) struct ClassificationResult {
    pub(all) struct CliConfig {
    pub(all) struct CommonErrorPattern {
    pub(all) struct ComplexLayoutAnalysis {
    pub(all) enum ComplexLayoutType {
    pub(all) struct ConfusionEntry {
    pub(all) struct ConfusionMatrix {
    pub(all) struct CorrectionEntry {
    pub(all) struct CorrectionResult {
    pub(all) struct DLCnnModelConfig {
    pub(all) struct DLConv2DConfig {
    pub(all) struct DLDenseConfig {
    pub(all) struct DLFeatureExtractor {
    pub(all) struct DLInferenceResult {
    pub(all) enum DLLayerType {
    pub(all) struct DLNeuralLayer {
    pub(all) struct DLTrainingHistory {
    pub(all) struct DLTrainingSample {
    pub(all) struct DataLoader {
    pub(all) enum DeploymentEnvironment {
    pub(all) struct DictCharEntry {
    pub(all) struct DictCharMatch {
    pub(all) enum DictCharStructure {
    pub(all) struct DictChineseDict {
    pub(all) struct DictComponent {
    pub(all) struct DictComponentResult {
    pub(all) struct Dictionary {
    pub(all) struct DictionaryEntry {
    pub(all) struct DigitOcrConfig {
    pub(all) enum DistanceMetric {
    pub(all) struct DistortionDetectionResult {
    pub(all) enum DistortionType {
    pub(all) struct DockerConfig {
    pub(all) struct DocumentBlock {
    pub(all) enum DocumentBlockType {
    pub(all) struct DocumentElement {
    pub(all) enum DocumentElementType {
    pub(all) struct DocumentStructure {
    pub(all) struct DocumentTreeNode {
    pub(all) struct DocumentUnderstandingEnhancedConfig {
    pub(all) struct DropFallResult {
    pub(all) struct EnglishOcrConfig {
    pub(all) struct EnhancedChineseOcrConfig {
    pub(all) struct EnhancedDocument {
    pub(all) struct EnhancedDocumentElement {
    pub(all) struct EnhancedTableResult {
    pub(all) struct EnsembleConfig {
    pub(all) struct ErrorAnalysisEntry {
    pub(all) struct ErrorAnalysisReport {
    pub(all) struct ExtractedImage {
    pub(all) struct GridFeatures {
    pub(all) struct HandwritingCharFeature {
    pub(all) struct HandwritingOcrConfig {
    pub(all) struct HandwritingOcrEnhancedConfig {
    pub(all) struct HandwritingRecognitionConfig {
    pub(all) struct HandwritingRecognitionResult {
    pub(all) struct HandwritingStrokeFeatures {
    pub(all) enum HandwritingStyle {
    pub(all) struct HandwritingTemplate {
    pub(all) struct HogFeatures {
    pub(all) struct KnnClassifier {
    pub(all) struct LRSchedulerConfig {
    pub(all) enum LRSchedulerType {
    pub(all) struct LanguageDetectionResult {
    pub(all) struct LanguageModelState {
    pub(all) enum LanguageType {
    pub(all) enum LayoutType {
    pub(all) struct LbpFeatures {
    pub(all) struct ListItemInfo {
    pub(all) enum ListItemType {
    pub(all) struct MarkdownDocument {
    pub(all) struct MarkdownElement {
    pub(all) enum MarkdownElementType {
    pub(all) struct MarkdownImage {
    pub(all) struct MarkdownSymbol {
    pub(all) struct MarkdownTable {
    pub(all) struct MemoryUsageStats {
    pub(all) struct ModelPackageConfig {
    pub(all) struct MultilingualOcrConfig {
    pub(all) struct MultilingualOcrEnhancedConfig {
    pub(all) struct NgramModel {
    pub(all) struct OCRPageResult {
    pub(all) struct OcrAccuracyEnhancedConfig {
    pub(all) struct OcrCharResult {
    pub(all) struct OcrConnectedComponent {
    pub(all) struct OcrConnectedComponentsResult {
    pub(all) enum OcrErrorType {
    pub(all) struct OcrResult {
    pub(all) struct OptimizerConfig {
    pub(all) enum OptimizerType {
    pub(all) struct PageRegion {
    pub(all) enum PageRegionType {
    pub(all) struct PerformanceBenchmark {
    pub(all) struct PostProcessConfig {
    pub(all) struct ProjectionFeatures {
    pub(all) struct ProjectionResult {
    pub(all) struct PunctuationTemplate {
    pub(all) struct RobustnessReport {
    pub(all) struct ScanOCRConfig {
    pub(all) struct ScanQuality {
    pub(all) enum ScanQualityLevel {
    pub(all) struct SimilarCharMapping {
    pub(all) struct SplitPoint {
    pub(all) struct StatisticalFeatures {
    pub(all) struct StrokeFeature {
    pub(all) struct StrokeSegmentationResult {
    pub(all) enum StrokeType {
    pub(all) struct TableCell {
    pub(all) struct TableCellContent {
    pub(all) struct TableDetectionResult {
    pub(all) struct TableLine {
    pub(all) enum TableLineType {
    pub(all) struct TableStructure {
    pub(all) struct TemplateMatcher {
    pub(all) struct TextBlock {
    pub(all) struct TextLine {
    pub(all) struct TextLineAttributes {
    pub(all) struct TextLineInfo {
    pub(all) struct TextRegion {
    pub(all) enum TextRegionType {
    pub(all) struct TrainingConfig {
    pub(all) struct TrainingDataset {
    pub(all) struct TrainingMetrics {
    pub(all) struct TrainingSample {
    pub(all) struct TrainingState {

    #API

    pub fn adaptive_threshold_ocr(@types.Image, block_size? : Int, c? : Int) -> @types.Image raise @types.LoadError
    pub fn advanced_chinese_ocr_default_config() -> AdvancedChineseOcrConfig
    pub fn analyze_complex_layout(Array[TextBlock], Int, Int) -> ComplexLayoutAnalysis
    pub fn analyze_document_layout(@types.Image) -> DocumentStructure raise @types.LoadError
    pub fn analyze_layout_enhanced(@types.Image, config? : DocumentUnderstandingEnhancedConfig) -> Array[DocumentBlock] raise @types.LoadError
    pub fn analyze_layout_scan(@types.Image) -> Array[TextBlock] raise @types.LoadError
    pub fn analyze_markdown_element_distribution(MarkdownDocument) -> Array[(String, Int)]
    pub fn analyze_table_results(Array[EnhancedTableResult]) -> Array[(String, Int)]
    pub fn analyze_table_structure(Array[TableLine], Array[TableLine]) -> TableStructure raise @types.LoadError
    pub fn apply_augmentation(DLTrainingSample, AugmentationConfig) -> DLTrainingSample
    pub fn augment_features(Array[Double], noise_level? : Double) -> Array[Double]
    pub fn augment_random_noise(DLTrainingSample, Double) -> DLTrainingSample
    pub fn augment_random_rotation(DLTrainingSample, Double) -> DLTrainingSample
    pub fn augment_random_scale(DLTrainingSample, Double) -> DLTrainingSample
    pub fn augment_random_shift(DLTrainingSample, Double) -> DLTrainingSample
    pub fn background_normalization(@types.Image, kernel_size? : Int) -> @types.Image raise @types.LoadError
    pub fn batch_correct_texts(Array[String], context_type? : String) -> Array[CorrectionResult] raise @types.LoadError
    pub fn batch_recognize_chars(Array[@types.Image], DLCnnModelConfig, Array[String]) -> Array[DLInferenceResult] raise @types.LoadError
    pub fn batch_scan_ocr(Array[@types.Image], ScanOCRConfig) -> Array[OCRPageResult] raise @types.LoadError
    pub fn batch_summary_to_string(BatchResultSummary) -> String
    pub fn build_document_structure_tree(Array[DocumentBlock]) -> Array[DocumentTreeNode]
    pub fn build_enhanced_elements(Array[TextLineAttributes], Int, Int) -> EnhancedDocument raise @types.LoadError
    pub fn build_gaussian_kernel_lut(Double, Int) -> Array[Double] raise @types.LoadError
    pub fn build_grayscale_lut() -> Array[Int]
    pub fn build_markdown_document(OCRPageResult, title? : String) -> MarkdownDocument raise @types.LoadError
    pub fn build_threshold_lut(Int) -> Array[Int]
    pub fn cache_friendly_horizontal_projection(@types.Image) -> Array[Int] raise @types.LoadError
    pub fn cache_friendly_vertical_projection(@types.Image) -> Array[Int] raise @types.LoadError
    pub fn calculate_accuracy(Array[Int], Array[Int]) -> Double
    pub fn calculate_accuracy_improvement(Array[CorrectionResult], Array[String]) -> (Double, Double, Double)
    pub fn calculate_accuracy_stats(Array[String], Array[String]) -> AccuracyStats raise @types.LoadError
    pub fn calculate_batch_progress(Array[BatchTask], Double) -> BatchProgress raise @types.LoadError
    pub fn calculate_char_accuracy(String, String) -> Double
    pub fn calculate_chinese_similarity(DictCharEntry, DictCharEntry) -> Double
    pub fn calculate_edit_distance(String, String) -> Int
    pub fn calculate_learning_rate(LRSchedulerConfig, Int, Double, Double) -> Double raise @types.LoadError
    pub fn calculate_word_accuracy(String, String) -> Double
    pub fn calibrate_confidence(OcrResult, factor? : Double) -> OcrResult raise @types.LoadError
    pub fn calibrate_confidence_enhanced(Double, Array[Double]) -> Double
    pub fn chebyshev_distance(Array[Double], Array[Double]) -> Double raise @types.LoadError
    pub fn check_accuracy_threshold(AccuracyStats, min_char_accuracy? : Double, min_word_accuracy? : Double, min_f1_score? : Double) -> (Bool, Array[String]) raise @types.LoadError
    pub fn check_early_stopping(TrainingState, TrainingConfig, Double) -> (Bool, TrainingState)
    pub fn chinese_ocr_default_config() -> ChineseOcrConfig
    pub fn classify_markdown_element(TextBlock, avg_font_size? : Double) -> MarkdownElementType
    pub fn cnn_confusion_matrix(Array[DLTrainingSample], DLCnnModelConfig, Array[String]) -> Array[Array[Int]] raise @types.LoadError
    pub fn cnn_infer(Array[Double], DLCnnModelConfig, Array[String]) -> DLInferenceResult
    pub fn cnn_recognize_char(@types.Image, DLCnnModelConfig, Array[String]) -> DLInferenceResult raise @types.LoadError
    pub fn cnn_recognize_digits(@types.Image, DLCnnModelConfig) -> DLInferenceResult raise @types.LoadError
    pub fn cnn_recognize_letters(@types.Image, DLCnnModelConfig) -> DLInferenceResult raise @types.LoadError
    pub fn cnn_train(Array[DLTrainingSample], Array[Double], Array[Double], Array[Double], Array[Double], Int, Int, Int, Int, Int, Int, Double, Int) -> (Array[Double], Array[Double], Array[Double], Array[Double], Array[DLTrainingHistory]) raise @types.LoadError
    pub fn cnn_train_step(Array[Double], Int, Array[Double], Array[Double], Array[Double], Array[Double], Int, Int, Int, Int, Int, Int, Double) -> (Array[Double], Array[Double], Array[Double], Array[Double], Double) raise @types.LoadError
    pub fn combined_features(@types.Image) -> Array[Double] raise @types.LoadError
    pub fn complete_char_segmentation(@types.Image, min_char_width? : Int, max_char_width? : Int) -> Array[(Int, Int, Int, Int)] raise @types.LoadError
    pub fn compute_confusion_matrix(Array[Int], Array[Int], Int) -> Array[Array[Int]]
    pub fn compute_distance(Array[Double], Array[Double], DistanceMetric) -> Double raise @types.LoadError
    pub fn compute_per_class_accuracy(Array[Array[Int]]) -> Array[Double]
    pub fn compute_reading_order(Array[DocumentElement]) -> Array[Int] raise @types.LoadError
    pub fn connected_components_analysis(@types.Image, connectivity? : Int) -> OcrConnectedComponentsResult raise @types.LoadError
    pub fn conv2d(Array[Double], Int, Int, Int, Array[Double], Int, Int, Int, Int) -> Array[Double] raise @types.LoadError
    pub fn correct_common_patterns(String) -> CorrectionResult
    pub fn correct_similar_chars(String, String) -> CorrectionResult raise @types.LoadError
    pub fn correct_slant(@types.Image, max_slant? : Double) -> @types.Image raise @types.LoadError
    pub fn cosine_distance(Array[Double], Array[Double]) -> Double raise @types.LoadError
    pub fn cosine_similarity(Array[Double], Array[Double]) -> Double
    pub fn create_batch_tasks(Array[String], String, String) -> Array[BatchTask] raise @types.LoadError
    pub fn create_data_loader(Array[DLTrainingSample], Int, Bool) -> DataLoader raise @types.LoadError
    pub fn create_default_api_server_config() -> ApiServerConfig
    pub fn create_default_batch_config() -> BatchOcrConfig
    pub fn create_default_char_cnn_config(Int) -> DLCnnModelConfig
    pub fn create_default_chinese_dictionary() -> DictChineseDict
    pub fn create_default_cli_config() -> CliConfig
    pub fn create_default_docker_config() -> DockerConfig
    pub fn create_default_handwriting_config() -> HandwritingRecognitionConfig
    pub fn create_default_language_model() -> LanguageModelState
    pub fn create_default_model_package_config() -> ModelPackageConfig
    pub fn create_default_training_config() -> TrainingConfig
    pub fn create_feature_extractor(String, Int) -> DLFeatureExtractor
    pub fn create_handwriting_template(String, HandwritingStyle, Array[@types.Image]) -> HandwritingTemplate raise @types.LoadError
    pub fn create_neural_layer(DLLayerType, String, Array[Int]) -> DLNeuralLayer
    pub fn create_training_history(Int, Double, Double, Double, Double, Double, Double) -> DLTrainingHistory
    pub fn create_training_sample(@types.Image, Int, String) -> DLTrainingSample raise @types.LoadError
    pub fn create_training_state() -> TrainingState
    pub fn cross_entropy_loss(Array[Double], Int) -> Double
    pub fn dataset_add_sample(TrainingDataset, Array[Double], String) -> TrainingDataset
    pub fn dataset_create() -> TrainingDataset
    pub fn dataset_stats(TrainingDataset) -> (Int, Int, Array[(String, Int)])
    pub fn decompose_chinese_char(String) -> ChineseCharStructure raise @types.LoadError
    pub fn dense_backward(Array[Double], Array[Double], Int, Int) -> (Array[Double], Array[Double], Array[Double])
    pub fn dense_forward(Array[Double], Array[Double], Array[Double], Int, Int, String) -> Array[Double]
    pub fn deskew(@types.Image) -> @types.Image raise @types.LoadError
    pub fn detect_char_language(@types.Image) -> LanguageType raise @types.LoadError
    pub fn detect_column_boundaries(Array[TextLineAttributes], Int, LayoutType) -> Array[Int]
    pub fn detect_columns(@types.Image) -> (Int, Array[(Int, Int)]) raise @types.LoadError
    pub fn detect_distortions(@types.Image) -> Array[DistortionDetectionResult] raise @types.LoadError
    pub fn detect_document_columns(@types.Image) -> Int raise @types.LoadError
    pub fn detect_document_language(@types.Image) -> LanguageType raise @types.LoadError
    pub fn detect_handwriting_slant(@types.Image) -> Double raise @types.LoadError
    pub fn detect_header_footer(Array[TextLineAttributes], Int) -> (Int, Int) raise @types.LoadError
    pub fn detect_horizontal_lines(@types.Image, min_length? : Int, max_gap? : Int) -> Array[TableLine] raise @types.LoadError
    pub fn detect_horizontal_table_lines(@types.Image, min_length? : Int, max_gap? : Int) -> Array[(Int, Int, Int)] raise @types.LoadError
    pub fn detect_image_regions_markdown(@types.Image, min_area? : Int) -> Array[MarkdownImage] raise @types.LoadError
    pub fn detect_language_enhanced(@types.Image) -> LanguageDetectionResult raise @types.LoadError
    pub fn detect_layout_type(Array[TextLineAttributes], Int, Int) -> LayoutType raise @types.LoadError
    pub fn detect_list_item(TextLineAttributes) -> ListItemInfo
    pub fn detect_paragraphs(Array[DocumentBlock], max_line_spacing_ratio? : Double) -> Array[Array[Int]]
    pub fn detect_skew_angle(@types.Image) -> Double raise @types.LoadError
    pub fn detect_skew_angle_robust(@types.Image) -> Double raise @types.LoadError
    pub fn detect_table_enhanced(@types.Image, min_table_size? : Int) -> Array[EnhancedTableResult] raise @types.LoadError
    pub fn detect_text_lines_projection(@types.Image, min_height? : Int, max_gap? : Int) -> Array[TextLineInfo] raise @types.LoadError
    pub fn detect_text_regions(@types.Image) -> Array[TextRegion] raise @types.LoadError
    pub fn detect_titles(Array[DocumentBlock], title_font_size_threshold? : Int) -> Array[Int]
    pub fn detect_touching_chars(@types.Image, min_char_width? : Int, max_char_width? : Int) -> Array[Int] raise @types.LoadError
    pub fn detect_vertical_lines(@types.Image, min_length? : Int, max_gap? : Int) -> Array[TableLine] raise @types.LoadError
    pub fn detect_vertical_table_lines(@types.Image, min_length? : Int, max_gap? : Int) -> Array[(Int, Int, Int)] raise @types.LoadError
    pub fn determine_reading_order_markdown(Array[MarkdownElement]) -> Array[Int]
    pub fn dictionary_create(Array[String]) -> Dictionary raise @types.LoadError
    pub fn dictionary_create_common_english() -> Dictionary
    pub fn dictionary_match(String, Dictionary, max_distance? : Int) -> Array[(String, Int)] raise @types.LoadError
    pub fn digit_ocr_default_config() -> DigitOcrConfig
    pub fn document_enhance(@types.Image) -> @types.Image raise @types.LoadError
    pub fn document_statistics_enhanced(Array[DocumentBlock]) -> (Int, Int, Int, Int, Int, Int, Int)
    pub fn document_structure_stats(DocumentStructure) -> (Int, Int, Int, Int, Int)
    pub fn document_understanding_enhanced_default_config() -> DocumentUnderstandingEnhancedConfig
    pub fn drop_fall_segmentation(@types.Image, start_x? : Int) -> DropFallResult raise @types.LoadError
    pub fn edit_distance(String, String) -> Int raise @types.LoadError
    pub fn elastic_match(Array[Double], Array[Double], elasticity? : Double, grid_size? : Int) -> Double
    pub fn english_ocr_default_config() -> EnglishOcrConfig
    pub fn enhanced_chinese_ocr_default_config() -> EnhancedChineseOcrConfig
    pub fn enhanced_document_to_markdown(EnhancedDocument, include_header_footer? : Bool) -> String
    pub fn enhanced_element_distribution(EnhancedDocument) -> Array[(String, Int)]
    pub fn enhanced_table_to_markdown(EnhancedTableResult) -> String
    pub fn ensemble_default_config() -> EnsembleConfig
    pub fn ensemble_predict(Array[Double], KnnClassifier, Array[(String, Array[Double])], config? : EnsembleConfig) -> ClassificationResult raise @types.LoadError
    pub fn estimate_memory_usage(Int, Int, Int, Int) -> MemoryUsageStats
    pub fn euclidean_distance(Array[Double], Array[Double]) -> Double raise @types.LoadError
    pub fn evaluate_cnn_model(Array[DLTrainingSample], DLCnnModelConfig, Array[String]) -> (Double, Double) raise @types.LoadError
    pub fn evaluate_scan_quality(@types.Image) -> ScanQuality raise @types.LoadError
    pub fn extract_all_cells(@types.Image, TableStructure, padding? : Int) -> Array[@types.Image] raise @types.LoadError
    pub fn extract_cell_image(@types.Image, TableCell, padding? : Int) -> @types.Image raise @types.LoadError
    pub fn extract_char_image(@types.Image, CharSegment, target_size? : Int, padding? : Int) -> @types.Image raise @types.LoadError
    pub fn extract_combined_enhanced_features(@types.Image, OcrAccuracyEnhancedConfig) -> Array[Double] raise @types.LoadError
    pub fn extract_combined_ocr_features(@types.Image) -> Array[Double] raise @types.LoadError
    pub fn extract_directional_features(@types.Image) -> Array[Double]
    pub fn extract_document_text(Array[DocumentBlock], include_headers? : Bool, include_footers? : Bool) -> String
    pub fn extract_features(DLFeatureExtractor, @types.Image) -> Array[Double]
    pub fn extract_gabor_ocr_features(@types.Image, num_orientations? : Int, num_frequencies? : Int) -> Array[Double]
    pub fn extract_handwriting_features(@types.Image, String) -> HandwritingCharFeature raise @types.LoadError
    pub fn extract_handwriting_stroke_features(@types.Image) -> HandwritingStrokeFeatures raise @types.LoadError
    pub fn extract_headings(DocumentStructure) -> Array[DocumentElement]
    pub fn extract_hw_stroke_features(@types.Image) -> Array[StrokeFeature]
    pub fn extract_images_enhanced(@types.Image, min_area? : Int) -> Array[ExtractedImage]
    pub fn extract_paragraphs(DocumentStructure) -> Array[DocumentElement]
    pub fn extract_stroke_features(@types.Image) -> Array[Double] raise @types.LoadError
    pub fn extract_text_line_image(@types.Image, TextLineInfo, padding? : Int) -> @types.Image raise @types.LoadError
    pub fn extract_text_lines(@types.Image) -> Array[@types.Image] raise @types.LoadError
    pub fn extract_title(DocumentStructure) -> String
    pub fn extract_zernike_moments(@types.Image, max_order? : Int) -> Array[Double] raise @types.LoadError
    pub fn fast_connected_components(@types.Image) -> Array[Int] raise @types.LoadError
    pub fn fast_downsample_2x(@types.Image) -> @types.Image raise @types.LoadError
    pub fn fast_gaussian_blur_1d(@types.Image, Array[Double]) -> @types.Image raise @types.LoadError
    pub fn fast_threshold_lut(@types.Image, Array[Int]) -> @types.Image raise @types.LoadError
    pub fn filter_components_by_area(OcrConnectedComponentsResult, Int, Int) -> Array[OcrConnectedComponent] raise @types.LoadError
    pub fn filter_components_by_aspect_ratio(OcrConnectedComponentsResult, Double, Double) -> Array[OcrConnectedComponent] raise @types.LoadError
    pub fn filter_components_by_position(OcrConnectedComponentsResult, Int, Int, Int, Int) -> Array[OcrConnectedComponent] raise @types.LoadError
    pub fn filter_noise_segments(Array[(Int, Int, Int, Int)], Int, Int, min_area_ratio? : Double, max_area_ratio? : Double) -> Array[(Int, Int, Int, Int)] raise @types.LoadError
    pub fn find_line_intersections(Array[(Int, Int, Int)], Array[(Int, Int, Int)]) -> Array[(Int, Int)]
    pub fn find_similar_chinese_chars(DictChineseDict, String, top_n? : Int) -> Array[DictCharMatch] raise @types.LoadError
    pub fn full_postprocess_correction(String, context_type? : String) -> CorrectionResult raise @types.LoadError
    pub fn generate_3500_chinese_templates(char_set? : String) -> Array[(String, Array[Double])]
    pub fn generate_accuracy_report(AccuracyStats, String) -> String
    pub fn generate_api_config_json(ApiServerConfig) -> String
    pub fn generate_batch_summary(Array[BatchTask], Double) -> BatchResultSummary raise @types.LoadError
    pub fn generate_chinese_char_info_db() -> Array[ChineseCharInfo]
    pub fn generate_chinese_dictionary_report(DictChineseDict) -> String
    pub fn generate_chinese_templates(char_set? : String) -> Array[(String, Array[Double])]
    pub fn generate_cli_help() -> String
    pub fn generate_correction_report(Array[CorrectionResult]) -> String
    pub fn generate_deployment_package(DockerConfig, ApiServerConfig, ModelPackageConfig) -> String
    pub fn generate_digit_templates() -> Array[(String, Array[Double])]
    pub fn generate_docker_compose(DockerConfig) -> String
    pub fn generate_dockerfile(DockerConfig) -> String
    pub fn generate_english_templates(case_sensitive? : Bool) -> Array[(String, Array[Double])]
    pub fn generate_enhanced_chinese_templates(char_set_size? : Int) -> Array[(String, Array[Double])]
    pub fn generate_enhanced_handwriting_templates(char_set? : String, num_variants? : Int) -> Array[(String, Array[Double])]
    pub fn generate_env_config(DeploymentEnvironment) -> String
    pub fn generate_handwriting_templates(char_set? : String) -> Array[(String, Array[Double])]
    pub fn generate_health_check_config(ApiServerConfig) -> String
    pub fn generate_image_extraction_report(Array[ExtractedImage]) -> String
    pub fn generate_markdown_image_placeholder(MarkdownImage, Int) -> String
    pub fn generate_model_manifest(ModelPackageConfig) -> String
    pub fn generate_performance_report(PerformanceBenchmark, String) -> String
    pub fn generate_punctuation_templates() -> Array[PunctuationTemplate]
    pub fn generate_robustness_report(ScanQuality, Array[DistortionDetectionResult], ComplexLayoutAnalysis) -> RobustnessReport
    pub fn generate_training_progress_report(TrainingState, TrainingConfig) -> String
    pub fn generate_training_report(Array[DLTrainingHistory], DLCnnModelConfig) -> String
    pub fn get_elements_in_reading_order(DocumentStructure) -> Array[DocumentElement]
    pub fn grid_features(@types.Image, grid_rows? : Int, grid_cols? : Int) -> GridFeatures raise @types.LoadError
    pub fn handwriting_feature_similarity(HandwritingCharFeature, HandwritingCharFeature) -> Double
    pub fn handwriting_ocr_default_config() -> HandwritingOcrConfig
    pub fn handwriting_ocr_enhanced_default_config() -> HandwritingOcrEnhancedConfig
    pub fn handwriting_postprocess(String, Double) -> (String, Double)
    pub fn handwriting_report_to_string(HandwritingRecognitionResult) -> String
    pub fn hog_features(@types.Image, cell_size? : Int, num_bins? : Int) -> HogFeatures raise @types.LoadError
    pub fn horizontal_projection(@types.Image) -> ProjectionResult raise @types.LoadError
    pub fn hu_moments_features(@types.Image) -> Array[Double] raise @types.LoadError
    pub fn is_code_block_line(TextLineAttributes, Int) -> Bool
    pub fn is_heading_line(TextLineAttributes, Double) -> (Bool, Int)
    pub fn is_quote_line(TextLineAttributes, Int) -> Bool
    pub fn knn_add_sample(KnnClassifier, Array[Double], String) -> KnnClassifier raise @types.LoadError
    pub fn knn_add_samples(KnnClassifier, Array[(Array[Double], String)]) -> KnnClassifier raise @types.LoadError
    pub fn knn_create(k? : Int, distance_metric? : String) -> KnnClassifier raise @types.LoadError
    pub fn knn_predict(KnnClassifier, Array[Double]) -> ClassificationResult raise @types.LoadError
    pub fn language_model_postprocess(String, Array[String], Array[Double]) -> (String, Array[Double])
    pub fn lbp_features(@types.Image, radius? : Int, num_points? : Int, num_bins? : Int) -> LbpFeatures raise @types.LoadError
    pub fn load_model(String) -> DLCnnModelConfig?
    pub fn lookup_by_pinyin(DictChineseDict, String) -> Array[DictCharEntry] raise @types.LoadError
    pub fn lookup_by_radical(DictChineseDict, String) -> Array[DictCharEntry] raise @types.LoadError
    pub fn lookup_by_structure(DictChineseDict, DictCharStructure) -> Array[DictCharEntry]
    pub fn lookup_char(DictChineseDict, String) -> DictCharEntry? raise @types.LoadError
    pub fn manhattan_distance(Array[Double], Array[Double]) -> Double raise @types.LoadError
    pub fn mark_task_completed(BatchTask, Int, Double, Double) -> BatchTask
    pub fn mark_task_failed(BatchTask, String, Double) -> BatchTask
    pub fn markdown_document_to_string(MarkdownDocument) -> String
    pub fn markdown_table_to_string(MarkdownTable) -> String
    pub fn max_pool2d(Array[Double], Int, Int, Int, Int) -> Array[Double] raise @types.LoadError
    pub fn max_pool2d_backward(Array[Double], Array[Double], Int, Int, Int, Int) -> Array[Double]
    pub fn merge_adjacent_components(Array[OcrConnectedComponent], Int) -> Array[OcrConnectedComponent] raise @types.LoadError
    pub fn merge_small_segments(Array[(Int, Int, Int, Int)], Int, Int) -> Array[(Int, Int, Int, Int)] raise @types.LoadError
    pub fn multi_scale_recognize(@types.Image, Array[(String, Array[Double])], Array[Int], distance_metric? : String) -> (String, Double)
    pub fn multilingual_ocr_default_config() -> MultilingualOcrConfig
    pub fn multilingual_ocr_enhanced_default_config() -> MultilingualOcrEnhancedConfig
    pub fn next_batch(DataLoader) -> (Array[DLTrainingSample], DataLoader) raise @types.LoadError
    pub fn ngram_create(Array[String], n? : Int) -> NgramModel raise @types.LoadError
    pub fn ngram_score(String, NgramModel) -> Double raise @types.LoadError
    pub fn niblack_threshold(@types.Image, window_size? : Int, k? : Double) -> @types.Image raise @types.LoadError
    pub fn normalize_features(Array[Double]) -> Array[Double] raise @types.LoadError
    pub fn normalize_handwriting_size(@types.Image, Int) -> @types.Image raise @types.LoadError
    pub fn normalize_image(Array[Double], Double, Double) -> Array[Double] raise @types.LoadError
    pub fn normalize_punctuation(String, Array[String]) -> String
    pub fn ocr_accuracy_enhanced_default_config() -> OcrAccuracyEnhancedConfig
    pub fn ocr_pipeline_stats(@types.Image) -> (Int, Int, Double) raise @types.LoadError
    pub fn ocr_postprocess(OcrResult, config? : PostProcessConfig, dictionary? : Dictionary, ngram_model? : NgramModel) -> OcrResult raise @types.LoadError
    pub fn ocr_preprocess(@types.Image, binarization_method? : String) -> @types.Image raise @types.LoadError
    pub fn ocr_result_to_hocr(OCRPageResult) -> String
    pub fn ocr_result_to_json(OCRPageResult) -> String
    pub fn ocr_result_to_text(OCRPageResult) -> String
    pub fn optimize_reading_order(Array[DocumentBlock], Int) -> Array[Int]
    pub fn otsu_threshold(@types.Image) -> @types.Image raise @types.LoadError
    pub fn parse_cli_args(Array[String]) -> CliConfig raise @types.LoadError
    pub fn postprocess_default_config() -> PostProcessConfig
    pub fn progress_bar_to_string(Double, width? : Int) -> String
    pub fn projection_features(@types.Image) -> ProjectionFeatures raise @types.LoadError
    pub fn recognize_by_components(DictChineseDict, DictCharStructure, Array[String], stroke_count_hint? : Int) -> Array[(String, Double)]
    pub fn recognize_chinese(@types.Image, config? : ChineseOcrConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_chinese_advanced(@types.Image, config? : AdvancedChineseOcrConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_digits(@types.Image, config? : DigitOcrConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_english(@types.Image, config? : EnglishOcrConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_enhanced_chinese(@types.Image, config? : EnhancedChineseOcrConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_handwriting(@types.Image, config? : HandwritingOcrConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_handwriting_char(@types.Image, Array[HandwritingTemplate], HandwritingRecognitionConfig) -> HandwritingRecognitionResult raise @types.LoadError
    pub fn recognize_handwriting_enhanced(@types.Image, config? : HandwritingOcrEnhancedConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_multilingual(@types.Image, config? : MultilingualOcrConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_multilingual_enhanced(@types.Image, config? : MultilingualOcrEnhancedConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_ocr_enhanced(@types.Image, Array[(String, Array[Double])], config? : OcrAccuracyEnhancedConfig) -> OcrResult raise @types.LoadError
    pub fn recognize_symbols_markdown(String) -> Array[MarkdownSymbol]
    pub fn recognize_table(@types.Image, min_line_length? : Int) -> TableStructure raise @types.LoadError
    pub fn record_training_metrics(TrainingState, TrainingMetrics) -> TrainingState
    pub fn relu(Double) -> Double
    pub fn relu_backward(Array[Double], Array[Double]) -> Array[Double]
    pub fn resize_image_for_cnn(@types.Image, Int, Int) -> Array[Double] raise @types.LoadError
    pub fn robustness_report_to_string(RobustnessReport) -> String
    pub fn rotate_document(@types.Image, Double) -> @types.Image raise @types.LoadError
    pub fn sauvola_threshold(@types.Image, window_size? : Int, k? : Double, r? : Double) -> @types.Image raise @types.LoadError
    pub fn save_model(DLCnnModelConfig, Array[Double], String) -> Bool
    pub fn scan_document_preprocess(@types.Image, ScanOCRConfig) -> @types.Image raise @types.LoadError
    pub fn scan_ocr_default_config() -> ScanOCRConfig
    pub fn scan_ocr_recognize(@types.Image, ScanOCRConfig) -> OCRPageResult raise @types.LoadError
    pub fn segment_by_connected_components(@types.Image, min_area? : Int, max_area? : Int) -> Array[(Int, Int, Int, Int)] raise @types.LoadError
    pub fn segment_chars_projection(@types.Image, TextLineInfo, min_width? : Int, max_gap? : Int) -> Array[CharSegment] raise @types.LoadError
    pub fn segment_connected_strokes(@types.Image, HandwritingRecognitionConfig) -> StrokeSegmentationResult
    pub fn segment_cursive_chars(@types.Image, min_char_width? : Int, max_char_width? : Int) -> Array[(Int, Int, Int, Int)]
    pub fn segment_page(@types.Image) -> Array[TextRegion] raise @types.LoadError
    pub fn segment_paragraphs(Array[TextLineAttributes]) -> Array[Array[TextLineAttributes]]
    pub fn select_adaptive_config(ScanQuality) -> AdaptivePreprocessConfig raise @types.LoadError
    pub fn shadow_removal(@types.Image, kernel_size? : Int) -> @types.Image raise @types.LoadError
    pub fn sigmoid(Double) -> Double
    pub fn sigmoid_backward(Array[Double], Array[Double]) -> Array[Double]
    pub fn smart_reading_order(Array[EnhancedDocumentElement], LayoutType, Array[Int]) -> Array[Int] raise @types.LoadError
    pub fn smart_segment_chars(@types.Image, MultilingualOcrEnhancedConfig) -> Array[(Int, Int, Int, Int, String)] raise @types.LoadError
    pub fn smart_spacing_process(String, Array[String]) -> String
    pub fn softmax(Array[Double]) -> Array[Double]
    pub fn softmax_cross_entropy_backward(Array[Double], Int) -> Array[Double] raise @types.LoadError
    pub fn split_train_validation(Array[DLTrainingSample], Double, Bool) -> (Array[DLTrainingSample], Array[DLTrainingSample])
    pub fn standardize_features(Array[Double]) -> Array[Double] raise @types.LoadError
    pub fn statistical_features(@types.Image) -> StatisticalFeatures raise @types.LoadError
    pub fn structure_based_filter(@types.Image, Array[ChineseCharInfo], max_candidates? : Int) -> Array[ChineseCharInfo]
    pub fn template_matcher_add(TemplateMatcher, String, Array[Double]) -> TemplateMatcher raise @types.LoadError
    pub fn template_matcher_create(distance_metric? : String) -> TemplateMatcher
    pub fn template_matcher_predict(TemplateMatcher, Array[Double]) -> ClassificationResult raise @types.LoadError
    pub fn understand_document(@types.Image) -> DocumentStructure raise @types.LoadError
    pub fn understand_document_enhanced(@types.Image, config? : DocumentUnderstandingEnhancedConfig) -> (Array[DocumentBlock], Array[DocumentTreeNode], String) raise @types.LoadError
    pub fn unrolled_pixel_sum(@types.Image) -> Int raise @types.LoadError
    pub fn update_task_progress(BatchTask, Double, Int, Int) -> BatchTask
    pub fn update_weights_sgd(Array[Double], Array[Double], Double) -> Array[Double] raise @types.LoadError
    pub fn vertical_projection(@types.Image) -> ProjectionResult raise @types.LoadError
    pub fn weighted_knn_classify(Array[Double], Array[(String, Array[Double])], k? : Int, distance_metric? : String) -> (String, Double, Array[(String, Double)])
    pub fn AugmentationType::equal(Self, Self) -> Bool
    pub fn AugmentationType::not_equal(Self, Self) -> Bool
    pub fn BatchTaskStatus::equal(Self, Self) -> Bool
    pub fn BatchTaskStatus::not_equal(Self, Self) -> Bool
    pub fn ComplexLayoutType::equal(Self, Self) -> Bool
    pub fn ComplexLayoutType::not_equal(Self, Self) -> Bool
    pub fn DLLayerType::equal(Self, Self) -> Bool
    pub fn DLLayerType::not_equal(Self, Self) -> Bool
    pub fn DeploymentEnvironment::equal(Self, Self) -> Bool
    pub fn DeploymentEnvironment::not_equal(Self, Self) -> Bool
    pub fn DictCharStructure::equal(Self, Self) -> Bool
    pub fn DictCharStructure::not_equal(Self, Self) -> Bool
    pub fn DistanceMetric::equal(Self, Self) -> Bool
    pub fn DistanceMetric::not_equal(Self, Self) -> Bool
    pub fn DistortionType::equal(Self, Self) -> Bool
    pub fn DistortionType::not_equal(Self, Self) -> Bool
    pub fn DocumentBlockType::equal(Self, Self) -> Bool
    pub fn DocumentBlockType::not_equal(Self, Self) -> Bool
    pub fn DocumentElementType::equal(Self, Self) -> Bool
    pub fn DocumentElementType::not_equal(Self, Self) -> Bool
    pub fn HandwritingStyle::equal(Self, Self) -> Bool
    pub fn HandwritingStyle::not_equal(Self, Self) -> Bool
    pub fn LRSchedulerType::equal(Self, Self) -> Bool
    pub fn LRSchedulerType::not_equal(Self, Self) -> Bool
    pub fn LanguageType::equal(Self, Self) -> Bool
    pub fn LanguageType::not_equal(Self, Self) -> Bool
    pub fn LayoutType::equal(Self, Self) -> Bool
    pub fn LayoutType::not_equal(Self, Self) -> Bool
    pub fn ListItemType::equal(Self, Self) -> Bool
    pub fn ListItemType::not_equal(Self, Self) -> Bool
    pub fn MarkdownElementType::equal(Self, Self) -> Bool
    pub fn MarkdownElementType::not_equal(Self, Self) -> Bool
    pub fn OcrErrorType::equal(Self, Self) -> Bool
    pub fn OcrErrorType::not_equal(Self, Self) -> Bool
    pub fn OptimizerType::equal(Self, Self) -> Bool
    pub fn OptimizerType::not_equal(Self, Self) -> Bool
    pub fn PageRegionType::equal(Self, Self) -> Bool
    pub fn PageRegionType::not_equal(Self, Self) -> Bool
    pub fn ScanQualityLevel::equal(Self, Self) -> Bool
    pub fn ScanQualityLevel::not_equal(Self, Self) -> Bool
    pub fn StrokeType::equal(Self, Self) -> Bool
    pub fn StrokeType::not_equal(Self, Self) -> Bool
    pub fn TableLineType::equal(Self, Self) -> Bool
    pub fn TableLineType::not_equal(Self, Self) -> Bool
    pub fn TextRegionType::equal(Self, Self) -> Bool
    pub fn TextRegionType::not_equal(Self, Self) -> Bool

    #纯 MoonBit 实现

    本包不依赖任何 C FFI,四目标(native/wasm-gc/js/wasm)均可编译运行。

    AccuracyStats

    pub(all) struct AccuracyStats {
    total_chars : Int
    correct_chars : Int
    char_accuracy : Double
    total_words : Int
    correct_words : Int
    word_accuracy : Double
    total_lines : Int
    correct_lines : Int
    line_accuracy : Double
    false_positives : Int
    false_negatives : Int
    precision : Double
    recall : Double
    f1_score : Double
    } derive(Eq,
    Debug
    )

    准确率统计

    AccuracyStats::equal

    automatically derived

    AccuracyStats::not_equal

    fn AccuracyStats::not_equal(x : AccuracyStats, y : AccuracyStats) -> Bool
    automatically derived

    AccuracyStats::to_repr

    automatically derived

    AdaptivePreprocessConfig

    pub(all) struct AdaptivePreprocessConfig {
    quality_level : ScanQualityLevel
    denoise_strength : Int
    contrast_enhance : Double
    binarization_method : String
    deskew_enabled : Bool
    sharpen_enabled : Bool
    morph_open_enabled : Bool
    morph_close_enabled : Bool
    recommended_dpi : Int
    } derive(Eq,
    Debug
    )

    自适应预处理配置

    AdaptivePreprocessConfig::equal

    automatically derived

    AdaptivePreprocessConfig::not_equal

    automatically derived

    AdaptivePreprocessConfig::to_repr

    automatically derived

    AdvancedChineseOcrConfig

    pub(all) struct AdvancedChineseOcrConfig {
    min_char_width : Int
    max_char_width : Int
    target_size : Int
    distance_metric : String
    char_set : String
    use_radical_decomposition : Bool
    use_structure_analysis : Bool
    } derive(Eq,
    Debug
    )

    完善中文 OCR 配置

    AdvancedChineseOcrConfig::equal

    automatically derived

    AdvancedChineseOcrConfig::not_equal

    automatically derived

    AdvancedChineseOcrConfig::to_repr

    automatically derived

    ApiServerConfig

    pub(all) struct ApiServerConfig {
    host : String
    port : Int
    max_concurrent_requests : Int
    request_timeout_ms : Int
    max_image_size_mb : Int
    enable_cors : Bool
    auth_token : String
    rate_limit_per_minute : Int
    } derive(Eq,
    Debug
    )

    API Server 配置

    ApiServerConfig::equal

    automatically derived

    ApiServerConfig::not_equal

    fn ApiServerConfig::not_equal(x : ApiServerConfig, y : ApiServerConfig) -> Bool
    automatically derived

    ApiServerConfig::to_repr

    automatically derived

    AugmentationConfig

    pub(all) struct AugmentationConfig {
    enabled : Bool
    augmentation_types : Array[AugmentationType]
    rotation_range : Double
    shift_range : Double
    scale_range : Double
    noise_level : Double
    blur_sigma : Double
    brightness_range : Double
    contrast_range : Double
    probability : Double
    } derive(Eq,
    Debug
    )

    数据增强配置

    AugmentationConfig::equal

    automatically derived

    AugmentationConfig::not_equal

    automatically derived

    AugmentationConfig::to_repr

    automatically derived

    AugmentationType

    pub(all) enum AugmentationType {
    RandomRotation
    RandomShift
    RandomScale
    RandomShear
    RandomNoise
    RandomBlur
    RandomBrightness
    RandomContrast
    ElasticTransform
    } derive(Eq,
    Debug
    )

    数据增强类型 #non_exhaustive 表示未来可能添加新构造器

    AugmentationType::equal

    automatically derived

    AugmentationType::not_equal

    fn AugmentationType::not_equal(x : AugmentationType, y : AugmentationType) -> Bool
    automatically derived

    AugmentationType::to_repr

    automatically derived

    BatchOcrConfig

    pub(all) struct BatchOcrConfig {
    max_concurrent : Int
    batch_size : Int
    enable_progress_callback : Bool
    enable_error_recovery : Bool
    output_format : String
    dpi : Int
    preprocess_config : String
    save_intermediate : Bool
    output_directory : String
    } derive(Eq,
    Debug
    )

    批处理配置

    BatchOcrConfig::equal

    automatically derived

    BatchOcrConfig::not_equal

    fn BatchOcrConfig::not_equal(x : BatchOcrConfig, y : BatchOcrConfig) -> Bool
    automatically derived

    BatchOcrConfig::to_repr

    automatically derived

    BatchProgress

    pub(all) struct BatchProgress {
    total_tasks : Int
    completed_tasks : Int
    failed_tasks : Int
    skipped_tasks : Int
    current_task_index : Int
    overall_progress : Double
    current_task_progress : Double
    elapsed_time_ms : Double
    estimated_remaining_ms : Double
    pages_per_second : Double
    chars_per_second : Double
    } derive(Eq,
    Debug
    )

    批处理进度

    BatchProgress::equal

    automatically derived

    BatchProgress::not_equal

    fn BatchProgress::not_equal(x : BatchProgress, y : BatchProgress) -> Bool
    automatically derived

    BatchProgress::to_repr

    automatically derived

    BatchResultSummary

    pub(all) struct BatchResultSummary {
    total_tasks : Int
    successful_tasks : Int
    failed_tasks : Int
    skipped_tasks : Int
    success_rate : Double
    total_pages : Int
    total_chars : Int
    total_time_ms : Double
    average_accuracy : Double
    average_pages_per_second : Double
    average_chars_per_second : Double
    failed_task_ids : Array[String]
    output_files : Array[String]
    } derive(Eq,
    Debug
    )

    批处理结果汇总

    BatchResultSummary::equal

    automatically derived

    BatchResultSummary::not_equal

    automatically derived

    BatchResultSummary::to_repr

    automatically derived

    BatchTask

    pub(all) struct BatchTask {
    task_id : String
    input_path : String
    output_path : String
    status : BatchTaskStatus
    progress : Double
    error_message : String
    start_time : Double
    end_time : Double
    page_count : Int
    char_count : Int
    accuracy_estimate : Double
    } derive(Eq,
    Debug
    )

    单个批处理任务

    BatchTask::equal

    fn BatchTask::equal(BatchTask, BatchTask) -> Bool
    automatically derived

    BatchTask::not_equal

    fn BatchTask::not_equal(x : BatchTask, y : BatchTask) -> Bool
    automatically derived

    BatchTask::to_repr

    automatically derived

    BatchTaskStatus

    pub(all) enum BatchTaskStatus {
    Pending
    Processing
    Completed
    Failed
    Skipped
    } derive(Eq,
    Debug
    )

    批处理任务状态

    BatchTaskStatus::equal

    automatically derived

    BatchTaskStatus::not_equal

    fn BatchTaskStatus::not_equal(x : BatchTaskStatus, y : BatchTaskStatus) -> Bool
    automatically derived

    BatchTaskStatus::to_repr

    automatically derived

    CharRecognitionResult

    pub(all) struct CharRecognitionResult {
    expected : String
    actual : String
    is_correct : Bool
    confidence : Double
    x : Int
    y : Int
    } derive(Eq,
    Debug
    )

    字符识别结果

    CharRecognitionResult::equal

    automatically derived

    CharRecognitionResult::not_equal

    automatically derived

    CharRecognitionResult::to_repr

    automatically derived

    CharSegment

    pub(all) struct CharSegment {
    x_start : Int
    x_end : Int
    width : Int
    y_start : Int
    y_end : Int
    height : Int
    pixel_count : Int
    } derive(Eq,
    Debug
    )

    字符分割结构体

    CharSegment::equal

    fn CharSegment::equal(CharSegment, CharSegment) -> Bool
    automatically derived

    CharSegment::not_equal

    fn CharSegment::not_equal(x : CharSegment, y : CharSegment) -> Bool
    automatically derived

    CharSegment::to_repr

    automatically derived

    ChineseCharInfo

    pub(all) struct ChineseCharInfo {
    char : String
    radical : String
    strokes : Int
    structure_type : String
    complexity : Int
    common_grade : Int
    } derive(Eq,
    Debug
    )

    汉字结构信息(增强版)

    ChineseCharInfo::equal

    automatically derived

    ChineseCharInfo::not_equal

    fn ChineseCharInfo::not_equal(x : ChineseCharInfo, y : ChineseCharInfo) -> Bool
    automatically derived

    ChineseCharInfo::to_repr

    automatically derived

    ChineseCharStructure

    pub(all) struct ChineseCharStructure {
    char : String
    radical : String
    strokes : Int
    structure_type : String
    components : Array[String]
    } derive(Eq,
    Debug
    )

    汉字结构信息

    ChineseCharStructure::equal

    automatically derived

    ChineseCharStructure::not_equal

    automatically derived

    ChineseCharStructure::to_repr

    automatically derived

    ChineseOcrConfig

    pub(all) struct ChineseOcrConfig {
    min_char_width : Int
    max_char_width : Int
    target_size : Int
    distance_metric : String
    char_set : String
    } derive(Eq,
    Debug
    )

    中文 OCR 配置

    ChineseOcrConfig::equal

    automatically derived

    ChineseOcrConfig::not_equal

    fn ChineseOcrConfig::not_equal(x : ChineseOcrConfig, y : ChineseOcrConfig) -> Bool
    automatically derived

    ChineseOcrConfig::to_repr

    automatically derived

    ChineseRadical

    pub(all) struct ChineseRadical {
    name : String
    strokes : Int
    position : String
    } derive(Eq,
    Debug
    )

    汉字部件结构体

    ChineseRadical::equal

    automatically derived

    ChineseRadical::not_equal

    fn ChineseRadical::not_equal(x : ChineseRadical, y : ChineseRadical) -> Bool
    automatically derived

    ChineseRadical::to_repr

    automatically derived

    ClassificationResult

    pub(all) struct ClassificationResult {
    label : String
    confidence : Double
    top_k : Array[(String, Double)]
    } derive(Eq,
    Debug
    )

    分类结果结构体

    ClassificationResult::equal

    automatically derived

    ClassificationResult::not_equal

    automatically derived

    ClassificationResult::to_repr

    automatically derived

    CliConfig

    pub(all) struct CliConfig {
    input_path : String
    output_path : String
    output_format : String
    language : String
    enable_handwriting : Bool
    enable_multilingual : Bool
    enable_document_analysis : Bool
    verbose : Bool
    batch_size : Int
    } derive(Eq,
    Debug
    )

    CLI 配置

    CliConfig::equal

    fn CliConfig::equal(CliConfig, CliConfig) -> Bool
    automatically derived

    CliConfig::not_equal

    fn CliConfig::not_equal(x : CliConfig, y : CliConfig) -> Bool
    automatically derived

    CliConfig::to_repr

    automatically derived

    CommonErrorPattern

    pub(all) struct CommonErrorPattern {
    pattern : String
    correction : String
    frequency : Int
    context_before : String
    context_after : String
    } derive(Eq,
    Debug
    )

    常见错误模式

    CommonErrorPattern::equal

    automatically derived

    CommonErrorPattern::not_equal

    automatically derived

    CommonErrorPattern::to_repr

    automatically derived

    ComplexLayoutAnalysis

    pub(all) struct ComplexLayoutAnalysis {
    layout_type : ComplexLayoutType
    num_columns : Int
    has_floating_elements : Bool
    has_cross_page_elements : Bool
    column_boundaries : Array[Int]
    reading_order_strategy : String
    confidence : Double
    } derive(Eq,
    Debug
    )

    复杂版面分析结果

    ComplexLayoutAnalysis::equal

    automatically derived

    ComplexLayoutAnalysis::not_equal

    automatically derived

    ComplexLayoutAnalysis::to_repr

    automatically derived

    ComplexLayoutType

    pub(all) enum ComplexLayoutType {
    SingleColumn
    DoubleColumn
    TripleColumn
    MultiColumnWithFloats
    MixedLayout
    TableHeavy
    ImageHeavy
    Unknown
    } derive(Eq,
    Debug
    )

    复杂版面类型 #non_exhaustive 表示未来可能添加新构造器

    ComplexLayoutType::equal

    automatically derived

    ComplexLayoutType::not_equal

    fn ComplexLayoutType::not_equal(x : ComplexLayoutType, y : ComplexLayoutType) -> Bool
    automatically derived

    ComplexLayoutType::to_repr

    automatically derived

    ConfusionEntry

    pub(all) struct ConfusionEntry {
    expected : String
    actual : String
    count : Int
    } derive(Eq,
    Debug
    )

    混淆矩阵条目

    ConfusionEntry::equal

    automatically derived

    ConfusionEntry::not_equal

    fn ConfusionEntry::not_equal(x : ConfusionEntry, y : ConfusionEntry) -> Bool
    automatically derived

    ConfusionEntry::to_repr

    automatically derived

    ConfusionMatrix

    pub(all) struct ConfusionMatrix {
    entries : Array[ConfusionEntry]
    total_errors : Int
    } derive(Eq,
    Debug
    )

    混淆矩阵

    ConfusionMatrix::equal

    automatically derived

    ConfusionMatrix::not_equal

    fn ConfusionMatrix::not_equal(x : ConfusionMatrix, y : ConfusionMatrix) -> Bool
    automatically derived

    ConfusionMatrix::to_repr

    automatically derived

    CorrectionEntry

    pub(all) struct CorrectionEntry {
    position : Int
    original_char : String
    corrected_char : String
    reason : String
    confidence : Double
    } derive(Eq,
    Debug
    )

    纠错条目

    CorrectionEntry::equal

    automatically derived

    CorrectionEntry::not_equal

    fn CorrectionEntry::not_equal(x : CorrectionEntry, y : CorrectionEntry) -> Bool
    automatically derived

    CorrectionEntry::to_repr

    automatically derived

    CorrectionResult

    pub(all) struct CorrectionResult {
    original : String
    corrected : String
    is_corrected : Bool
    confidence : Double
    corrections : Array[CorrectionEntry]
    } derive(Eq,
    Debug
    )

    纠错结果

    CorrectionResult::equal

    automatically derived

    CorrectionResult::not_equal

    fn CorrectionResult::not_equal(x : CorrectionResult, y : CorrectionResult) -> Bool
    automatically derived

    CorrectionResult::to_repr

    automatically derived

    DLCnnModelConfig

    pub(all) struct DLCnnModelConfig {
    model_name : String
    input_width : Int
    input_height : Int
    input_channels : Int
    num_classes : Int
    conv_layers : Array[DLConv2DConfig]
    dense_layers : Array[DLDenseConfig]
    learning_rate : Double
    batch_size : Int
    epochs : Int
    } derive(Eq,
    Debug
    )

    CNN 模型配置

    DLCnnModelConfig::equal

    automatically derived

    DLCnnModelConfig::not_equal

    fn DLCnnModelConfig::not_equal(x : DLCnnModelConfig, y : DLCnnModelConfig) -> Bool
    automatically derived

    DLCnnModelConfig::to_repr

    automatically derived

    DLConv2DConfig

    pub(all) struct DLConv2DConfig {
    in_channels : Int
    out_channels : Int
    kernel_size : Int
    stride : Int
    padding : Int
    activation : String
    } derive(Eq,
    Debug
    )

    卷积层配置

    DLConv2DConfig::equal

    automatically derived

    DLConv2DConfig::not_equal

    fn DLConv2DConfig::not_equal(x : DLConv2DConfig, y : DLConv2DConfig) -> Bool
    automatically derived

    DLConv2DConfig::to_repr

    automatically derived

    DLDenseConfig

    pub(all) struct DLDenseConfig {
    in_features : Int
    out_features : Int
    activation : String
    dropout_rate : Double
    } derive(Eq,
    Debug
    )

    全连接层配置

    DLDenseConfig::equal

    automatically derived

    DLDenseConfig::not_equal

    fn DLDenseConfig::not_equal(x : DLDenseConfig, y : DLDenseConfig) -> Bool
    automatically derived

    DLDenseConfig::to_repr

    automatically derived

    DLFeatureExtractor

    pub(all) struct DLFeatureExtractor {
    model_name : String
    feature_dim : Int
    layer_name : String
    weights : Array[Double]
    } derive(Eq,
    Debug
    )

    特征提取器

    DLFeatureExtractor::equal

    automatically derived

    DLFeatureExtractor::not_equal

    automatically derived

    DLFeatureExtractor::to_repr

    automatically derived

    DLInferenceResult

    pub(all) struct DLInferenceResult {
    predicted_class : Int
    predicted_label : String
    confidence : Double
    top_k_predictions : Array[(Int, Double)]
    inference_time_ms : Double
    } derive(Eq,
    Debug
    )

    推理结果

    DLInferenceResult::equal

    automatically derived

    DLInferenceResult::not_equal

    fn DLInferenceResult::not_equal(x : DLInferenceResult, y : DLInferenceResult) -> Bool
    automatically derived

    DLInferenceResult::to_repr

    automatically derived

    DLLayerType

    pub(all) enum DLLayerType {
    Conv2D
    MaxPool2D
    AvgPool2D
    Flatten
    Dense
    Dropout
    BatchNorm
    ReLU
    Softmax
    Sigmoid
    Tanh
    } derive(Eq,
    Debug
    )

    神经网络层类型 #non_exhaustive 表示未来可能添加新构造器

    DLLayerType::equal

    fn DLLayerType::equal(DLLayerType, DLLayerType) -> Bool
    automatically derived

    DLLayerType::not_equal

    fn DLLayerType::not_equal(x : DLLayerType, y : DLLayerType) -> Bool
    automatically derived

    DLLayerType::to_repr

    automatically derived

    DLNeuralLayer

    pub(all) struct DLNeuralLayer {
    layer_type : DLLayerType
    name : String
    config : String
    weights : Array[Double]
    biases : Array[Double]
    input_shape : Array[Int]
    output_shape : Array[Int]
    } derive(Eq,
    Debug
    )

    神经网络层

    DLNeuralLayer::equal

    automatically derived

    DLNeuralLayer::not_equal

    fn DLNeuralLayer::not_equal(x : DLNeuralLayer, y : DLNeuralLayer) -> Bool
    automatically derived

    DLNeuralLayer::to_repr

    automatically derived

    DLTrainingHistory

    pub(all) struct DLTrainingHistory {
    epoch : Int
    train_loss : Double
    train_accuracy : Double
    val_loss : Double
    val_accuracy : Double
    learning_rate : Double
    time_ms : Double
    } derive(Eq,
    Debug
    )

    训练历史

    DLTrainingHistory::equal

    automatically derived

    DLTrainingHistory::not_equal

    fn DLTrainingHistory::not_equal(x : DLTrainingHistory, y : DLTrainingHistory) -> Bool
    automatically derived

    DLTrainingHistory::to_repr

    automatically derived

    DLTrainingSample

    pub(all) struct DLTrainingSample {
    image_data : Array[Double]
    label : Int
    label_text : String
    width : Int
    height : Int
    } derive(Eq,
    Debug
    )

    训练样本

    DLTrainingSample::equal

    automatically derived

    DLTrainingSample::not_equal

    fn DLTrainingSample::not_equal(x : DLTrainingSample, y : DLTrainingSample) -> Bool
    automatically derived

    DLTrainingSample::to_repr

    automatically derived

    DataLoader

    pub(all) struct DataLoader {
    samples : Array[DLTrainingSample]
    batch_size : Int
    shuffle : Bool
    current_index : Int
    epoch : Int
    } derive(Eq,
    Debug
    )

    数据加载器

    DataLoader::equal

    fn DataLoader::equal(DataLoader, DataLoader) -> Bool
    automatically derived

    DataLoader::not_equal

    fn DataLoader::not_equal(x : DataLoader, y : DataLoader) -> Bool
    automatically derived

    DataLoader::to_repr

    automatically derived

    DeploymentEnvironment

    pub(all) enum DeploymentEnvironment {
    Development
    Staging
    Production
    } derive(Eq,
    Debug
    )

    部署环境类型 #non_exhaustive 表示未来可能添加新构造器

    DeploymentEnvironment::equal

    automatically derived

    DeploymentEnvironment::not_equal

    automatically derived

    DeploymentEnvironment::to_repr

    automatically derived

    DictCharEntry

    pub(all) struct DictCharEntry {
    char : String
    unicode : String
    pinyin : Array[String]
    stroke_count : Int
    structure : DictCharStructure
    radical : String
    components : Array[DictComponent]
    frequency : Int
    level : String
    } derive(Eq,
    Debug
    )

    汉字条目

    DictCharEntry::equal

    automatically derived

    DictCharEntry::not_equal

    fn DictCharEntry::not_equal(x : DictCharEntry, y : DictCharEntry) -> Bool
    automatically derived

    DictCharEntry::to_repr

    automatically derived

    DictCharMatch

    pub(all) struct DictCharMatch {
    target_char : String
    matched_char : String
    similarity : Double
    structure_match : Bool
    component_match_count : Int
    total_components : Int
    stroke_diff : Int
    } derive(Eq,
    Debug
    )

    汉字相似度匹配结果

    DictCharMatch::equal

    automatically derived

    DictCharMatch::not_equal

    fn DictCharMatch::not_equal(x : DictCharMatch, y : DictCharMatch) -> Bool
    automatically derived

    DictCharMatch::to_repr

    automatically derived

    DictCharStructure

    pub(all) enum DictCharStructure {
    LeftRight
    UpDown
    LeftMiddleRight
    UpMiddleDown
    Surround
    HalfSurround
    Independent
    Complex
    } derive(Eq,
    Debug
    )

    汉字结构类型 #non_exhaustive 表示未来可能添加新构造器

    DictCharStructure::equal

    automatically derived

    DictCharStructure::not_equal

    fn DictCharStructure::not_equal(x : DictCharStructure, y : DictCharStructure) -> Bool
    automatically derived

    DictCharStructure::to_repr

    automatically derived

    DictChineseDict

    pub(all) struct DictChineseDict {
    chars : Array[DictCharEntry]
    total_chars : Int
    level1_count : Int
    level2_count : Int
    level3_count : Int
    radical_index : Array[(String, Array[Int])]
    pinyin_index : Array[(String, Array[Int])]
    } derive(Eq,
    Debug
    )

    中文字库

    DictChineseDict::equal

    automatically derived

    DictChineseDict::not_equal

    fn DictChineseDict::not_equal(x : DictChineseDict, y : DictChineseDict) -> Bool
    automatically derived

    DictChineseDict::to_repr

    automatically derived

    DictComponent

    pub(all) struct DictComponent {
    name : String
    stroke_count : Int
    position : String
    width_ratio : Double
    height_ratio : Double
    } derive(Eq,
    Debug
    )

    汉字部件

    DictComponent::equal

    automatically derived

    DictComponent::not_equal

    fn DictComponent::not_equal(x : DictComponent, y : DictComponent) -> Bool
    automatically derived

    DictComponent::to_repr

    automatically derived

    DictComponentResult

    pub(all) struct DictComponentResult {
    char : String
    detected_components : Array[DictComponent]
    detected_structure : DictCharStructure
    confidence : Double
    candidate_chars : Array[(String, Double)]
    } derive(Eq,
    Debug
    )

    部件识别结果

    DictComponentResult::equal

    automatically derived

    DictComponentResult::not_equal

    automatically derived

    DictComponentResult::to_repr

    automatically derived

    Dictionary

    pub(all) struct Dictionary {
    words : Array[String]
    word_set : Array[String]
    } derive(Eq,
    Debug
    )

    词典结构体

    Dictionary::equal

    fn Dictionary::equal(Dictionary, Dictionary) -> Bool
    automatically derived

    Dictionary::not_equal

    fn Dictionary::not_equal(x : Dictionary, y : Dictionary) -> Bool
    automatically derived

    Dictionary::to_repr

    automatically derived

    DictionaryEntry

    pub(all) struct DictionaryEntry {
    word : String
    frequency : Int
    category : String
    } derive(Eq,
    Debug
    )

    词典条目

    DictionaryEntry::equal

    automatically derived

    DictionaryEntry::not_equal

    fn DictionaryEntry::not_equal(x : DictionaryEntry, y : DictionaryEntry) -> Bool
    automatically derived

    DictionaryEntry::to_repr

    automatically derived

    DigitOcrConfig

    pub(all) struct DigitOcrConfig {
    min_char_width : Int
    max_char_width : Int
    target_size : Int
    use_knn : Bool
    k : Int
    distance_metric : String
    } derive(Eq,
    Debug
    )

    数字 OCR 配置

    DigitOcrConfig::equal

    automatically derived

    DigitOcrConfig::not_equal

    fn DigitOcrConfig::not_equal(x : DigitOcrConfig, y : DigitOcrConfig) -> Bool
    automatically derived

    DigitOcrConfig::to_repr

    automatically derived

    DistanceMetric

    pub(all) enum DistanceMetric {
    Euclidean
    Manhattan
    Cosine
    Chebyshev
    } derive(Eq,
    Debug
    )

    距离度量类型 #non_exhaustive 表示未来可能添加新构造器

    DistanceMetric::equal

    automatically derived

    DistanceMetric::not_equal

    fn DistanceMetric::not_equal(x : DistanceMetric, y : DistanceMetric) -> Bool
    automatically derived

    DistanceMetric::to_repr

    automatically derived

    DistortionDetectionResult

    pub(all) struct DistortionDetectionResult {
    distortion_type : DistortionType
    severity : Double
    angle : Double
    confidence : Double
    correction_params : Array[(String, Double)]
    } derive(Eq,
    Debug
    )

    畸变检测结果

    DistortionDetectionResult::equal

    automatically derived

    DistortionDetectionResult::not_equal

    automatically derived

    DistortionDetectionResult::to_repr

    automatically derived

    DistortionType

    pub(all) enum DistortionType {
    Skew
    Perspective
    Barrel
    Pincushion
    UnevenLighting
    Blur
    Noise
    Unknown
    } derive(Eq,
    Debug
    )

    畸变类型 #non_exhaustive 表示未来可能添加新构造器

    DistortionType::equal

    automatically derived

    DistortionType::not_equal

    fn DistortionType::not_equal(x : DistortionType, y : DistortionType) -> Bool
    automatically derived

    DistortionType::to_repr

    automatically derived

    DockerConfig

    pub(all) struct DockerConfig {
    base_image : String
    app_port : Int
    memory_limit_mb : Int
    cpu_limit : Double
    enable_gpu : Bool
    environment : DeploymentEnvironment
    volumes : Array[(String, String)]
    } derive(Eq,
    Debug
    )

    Docker 配置

    DockerConfig::equal

    automatically derived

    DockerConfig::not_equal

    fn DockerConfig::not_equal(x : DockerConfig, y : DockerConfig) -> Bool
    automatically derived

    DockerConfig::to_repr

    automatically derived

    DocumentBlock

    pub(all) struct DocumentBlock {
    block_type : DocumentBlockType
    x : Int
    y : Int
    width : Int
    height : Int
    text : String
    confidence : Double
    font_size : Int
    is_bold : Bool
    is_italic : Bool
    line_spacing : Double
    indent_level : Int
    column_index : Int
    reading_order : Int
    parent_id : Int
    children_ids : Array[Int]
    } derive(Eq,
    Debug
    )

    文档块结构体(增强版)

    DocumentBlock::equal

    automatically derived

    DocumentBlock::not_equal

    fn DocumentBlock::not_equal(x : DocumentBlock, y : DocumentBlock) -> Bool
    automatically derived

    DocumentBlock::to_repr

    automatically derived

    DocumentBlockType

    pub(all) enum DocumentBlockType {
    Title
    Heading1
    Heading2
    Heading3
    Paragraph
    ListItem
    Table
    Image
    Caption
    Header
    Footer
    PageNumber
    Unknown
    } derive(Eq,
    Debug
    )

    文档块类型(增强版) #non_exhaustive 表示未来可能添加新构造器

    DocumentBlockType::equal

    automatically derived

    DocumentBlockType::not_equal

    fn DocumentBlockType::not_equal(x : DocumentBlockType, y : DocumentBlockType) -> Bool
    automatically derived

    DocumentBlockType::to_repr

    automatically derived

    DocumentElement

    pub(all) struct DocumentElement {
    element_type : DocumentElementType
    x : Int
    y : Int
    width : Int
    height : Int
    text : String
    confidence : Double
    font_size : Int
    font_weight : String
    reading_order : Int
    } derive(Eq,
    Debug
    )

    文档元素结构体

    DocumentElement::equal

    automatically derived

    DocumentElement::not_equal

    fn DocumentElement::not_equal(x : DocumentElement, y : DocumentElement) -> Bool
    automatically derived

    DocumentElement::to_repr

    automatically derived

    DocumentElementType

    pub(all) enum DocumentElementType {
    Title
    Subtitle
    Heading1
    Heading2
    Heading3
    Body
    Caption
    Footer
    Header
    List
    Table
    Image
    Unknown
    } derive(Eq,
    Debug
    )

    文档元素类型 #non_exhaustive 表示未来可能添加新构造器

    DocumentElementType::equal

    automatically derived

    DocumentElementType::not_equal

    automatically derived

    DocumentElementType::to_repr

    automatically derived

    DocumentStructure

    pub(all) struct DocumentStructure {
    elements : Array[DocumentElement]
    num_elements : Int
    title : String
    num_headings : Int
    num_paragraphs : Int
    reading_order : Array[Int]
    bounding_box : (Int, Int, Int, Int)
    } derive(Eq,
    Debug
    )

    文档结构结构体

    DocumentStructure::equal

    automatically derived

    DocumentStructure::not_equal

    fn DocumentStructure::not_equal(x : DocumentStructure, y : DocumentStructure) -> Bool
    automatically derived

    DocumentStructure::to_repr

    automatically derived

    DocumentTreeNode

    pub(all) struct DocumentTreeNode {
    node_id : Int
    block : DocumentBlock
    children : Array[DocumentTreeNode]
    depth : Int
    } derive(Eq,
    Debug
    )

    文档结构树节点

    DocumentTreeNode::equal

    automatically derived

    DocumentTreeNode::not_equal

    fn DocumentTreeNode::not_equal(x : DocumentTreeNode, y : DocumentTreeNode) -> Bool
    automatically derived

    DocumentTreeNode::to_repr

    automatically derived

    DocumentUnderstandingEnhancedConfig

    pub(all) struct DocumentUnderstandingEnhancedConfig {
    min_block_width : Int
    min_block_height : Int
    title_font_size_threshold : Int
    heading_font_size_threshold : Int
    max_line_spacing_ratio : Double
    enable_column_detection : Bool
    enable_hierarchy : Bool
    enable_title_detection : Bool
    } derive(Eq,
    Debug
    )

    增强文档理解配置

    DocumentUnderstandingEnhancedConfig::equal

    automatically derived

    DocumentUnderstandingEnhancedConfig::not_equal

    automatically derived

    DocumentUnderstandingEnhancedConfig::to_repr

    automatically derived

    DropFallResult

    pub(all) struct DropFallResult {
    split_points : Array[SplitPoint]
    char_regions : Array[(Int, Int)]
    success : Bool
    } derive(Eq,
    Debug
    )

    滴水算法分割结果

    DropFallResult::equal

    automatically derived

    DropFallResult::not_equal

    fn DropFallResult::not_equal(x : DropFallResult, y : DropFallResult) -> Bool
    automatically derived

    DropFallResult::to_repr

    automatically derived

    EnglishOcrConfig

    pub(all) struct EnglishOcrConfig {
    min_char_width : Int
    max_char_width : Int
    target_size : Int
    distance_metric : String
    case_sensitive : Bool
    } derive(Eq,
    Debug
    )

    英文 OCR 配置

    EnglishOcrConfig::equal

    automatically derived

    EnglishOcrConfig::not_equal

    fn EnglishOcrConfig::not_equal(x : EnglishOcrConfig, y : EnglishOcrConfig) -> Bool
    automatically derived

    EnglishOcrConfig::to_repr

    automatically derived

    EnhancedChineseOcrConfig

    pub(all) struct EnhancedChineseOcrConfig {
    min_char_width : Int
    max_char_width : Int
    target_size : Int
    distance_metric : String
    char_set_size : Int
    use_structure_filter : Bool
    use_stroke_features : Bool
    use_radical_hint : Bool
    } derive(Eq,
    Debug
    )

    增强中文 OCR 配置

    EnhancedChineseOcrConfig::equal

    automatically derived

    EnhancedChineseOcrConfig::not_equal

    automatically derived

    EnhancedChineseOcrConfig::to_repr

    automatically derived

    EnhancedDocument

    pub(all) struct EnhancedDocument {
    layout_type : LayoutType
    num_columns : Int
    page_width : Int
    page_height : Int
    header_height : Int
    footer_height : Int
    body_top : Int
    body_bottom : Int
    elements : Array[EnhancedDocumentElement]
    reading_order : Array[Int]
    column_boundaries : Array[Int]
    } derive(Eq,
    Debug
    )

    增强版文档结构

    EnhancedDocument::equal

    automatically derived

    EnhancedDocument::not_equal

    fn EnhancedDocument::not_equal(x : EnhancedDocument, y : EnhancedDocument) -> Bool
    automatically derived

    EnhancedDocument::to_repr

    automatically derived

    EnhancedDocumentElement

    pub(all) struct EnhancedDocumentElement {
    element_type : MarkdownElementType
    x : Int
    y : Int
    width : Int
    height : Int
    content : String
    confidence : Double
    font_size : Double
    font_weight : String
    alignment : String
    list_info : ListItemInfo
    column_index : Int
    indent_level : Int
    is_header : Bool
    is_footer : Bool
    } derive(Eq,
    Debug
    )

    增强版文档元素

    EnhancedDocumentElement::equal

    automatically derived

    EnhancedDocumentElement::not_equal

    automatically derived

    EnhancedDocumentElement::to_repr

    automatically derived

    EnhancedTableResult

    pub(all) struct EnhancedTableResult {
    x : Int
    y : Int
    width : Int
    height : Int
    rows : Int
    cols : Int
    cells : Array[TableCellContent]
    has_header : Bool
    header_rows : Int
    detection : TableDetectionResult
    confidence : Double
    } derive(Eq,
    Debug
    )

    完整表格识别结果

    EnhancedTableResult::equal

    automatically derived

    EnhancedTableResult::not_equal

    automatically derived

    EnhancedTableResult::to_repr

    automatically derived

    EnsembleConfig

    pub(all) struct EnsembleConfig {
    use_knn : Bool
    use_template : Bool
    use_svm_like : Bool
    knn_k : Int
    voting_method : String
    } derive(Eq,
    Debug
    )

    集成分类器配置

    EnsembleConfig::equal

    automatically derived

    EnsembleConfig::not_equal

    fn EnsembleConfig::not_equal(x : EnsembleConfig, y : EnsembleConfig) -> Bool
    automatically derived

    EnsembleConfig::to_repr

    automatically derived

    ErrorAnalysisEntry

    pub(all) struct ErrorAnalysisEntry {
    error_type : OcrErrorType
    expected : String
    actual : String
    context_before : String
    context_after : String
    confidence : Double
    count : Int
    } derive(Eq,
    Debug
    )

    错误分析条目

    ErrorAnalysisEntry::equal

    automatically derived

    ErrorAnalysisEntry::not_equal

    automatically derived

    ErrorAnalysisEntry::to_repr

    automatically derived

    ErrorAnalysisReport

    pub(all) struct ErrorAnalysisReport {
    total_errors : Int
    substitution_count : Int
    insertion_count : Int
    deletion_count : Int
    reorder_count : Int
    top_errors : Array[ErrorAnalysisEntry]
    suggestions : Array[String]
    } derive(Eq,
    Debug
    )

    错误分析报告

    ErrorAnalysisReport::equal

    automatically derived

    ErrorAnalysisReport::not_equal

    automatically derived

    ErrorAnalysisReport::to_repr

    automatically derived

    ExtractedImage

    pub(all) struct ExtractedImage {
    x : Int
    y : Int
    width : Int
    height : Int
    image_type : String
    confidence : Double
    aspect_ratio : Double
    fill_ratio : Double
    edge_density : Double
    file_name : String
    } derive(Eq,
    Debug
    )

    提取的图片区域

    ExtractedImage::equal

    automatically derived

    ExtractedImage::not_equal

    fn ExtractedImage::not_equal(x : ExtractedImage, y : ExtractedImage) -> Bool
    automatically derived

    ExtractedImage::to_repr

    automatically derived

    GridFeatures

    pub(all) struct GridFeatures {
    features : Array[Double]
    grid_rows : Int
    grid_cols : Int
    } derive(Eq,
    Debug
    )

    网格特征

    GridFeatures::equal

    automatically derived

    GridFeatures::not_equal

    fn GridFeatures::not_equal(x : GridFeatures, y : GridFeatures) -> Bool
    automatically derived

    GridFeatures::to_repr

    automatically derived

    HandwritingCharFeature

    pub(all) struct HandwritingCharFeature {
    char : String
    num_strokes : Int
    stroke_types : Array[StrokeType]
    aspect_ratio : Double
    density : Double
    center_of_mass_x : Double
    center_of_mass_y : Double
    horizontal_projection : Array[Double]
    vertical_projection : Array[Double]
    contour_complexity : Double
    slant_angle : Double
    size_normalized : Bool
    } derive(Eq,
    Debug
    )

    手写字符特征

    HandwritingCharFeature::equal

    automatically derived

    HandwritingCharFeature::not_equal

    automatically derived

    HandwritingCharFeature::to_repr

    automatically derived

    HandwritingOcrConfig

    pub(all) struct HandwritingOcrConfig {
    min_char_width : Int
    max_char_width : Int
    min_char_height : Int
    max_char_height : Int
    target_size : Int
    distance_metric : String
    flexibility : Double
    use_slant_correction : Bool
    } derive(Eq,
    Debug
    )

    手写体识别配置

    HandwritingOcrConfig::equal

    automatically derived

    HandwritingOcrConfig::not_equal

    automatically derived

    HandwritingOcrConfig::to_repr

    automatically derived

    HandwritingOcrEnhancedConfig

    pub(all) struct HandwritingOcrEnhancedConfig {
    min_char_width : Int
    max_char_width : Int
    min_char_height : Int
    max_char_height : Int
    target_size : Int
    distance_metric : String
    num_variants : Int
    elasticity : Double
    use_slant_correction : Bool
    use_elastic_matching : Bool
    use_stroke_features : Bool
    use_postprocessing : Bool
    } derive(Eq,
    Debug
    )

    增强手写体识别配置

    HandwritingOcrEnhancedConfig::equal

    automatically derived

    HandwritingOcrEnhancedConfig::not_equal

    automatically derived

    HandwritingOcrEnhancedConfig::to_repr

    automatically derived

    HandwritingRecognitionConfig

    pub(all) struct HandwritingRecognitionConfig {
    min_stroke_length : Double
    max_stroke_angle : Double
    segmentation_threshold : Double
    similarity_threshold : Double
    enable_slant_correction : Bool
    enable_size_normalization : Bool
    enable_stroke_order : Bool
    max_candidates : Int
    style_priority : HandwritingStyle
    } derive(Eq,
    Debug
    )

    手写识别配置

    HandwritingRecognitionConfig::equal

    automatically derived

    HandwritingRecognitionConfig::not_equal

    automatically derived

    HandwritingRecognitionConfig::to_repr

    automatically derived

    HandwritingRecognitionResult

    pub(all) struct HandwritingRecognitionResult {
    predicted_char : String
    confidence : Double
    top_candidates : Array[(String, Double)]
    detected_style : HandwritingStyle
    num_strokes_detected : Int
    slant_angle : Double
    preprocessing_time_ms : Double
    feature_extraction_time_ms : Double
    matching_time_ms : Double
    total_time_ms : Double
    } derive(Eq,
    Debug
    )

    手写识别结果

    HandwritingRecognitionResult::equal

    automatically derived

    HandwritingRecognitionResult::not_equal

    automatically derived

    HandwritingRecognitionResult::to_repr

    automatically derived

    HandwritingStrokeFeatures

    pub(all) struct HandwritingStrokeFeatures {
    num_strokes : Int
    stroke_directions : Array[Double]
    stroke_lengths : Array[Double]
    connectivity : Double
    curvature : Double
    } derive(Eq,
    Debug
    )

    手写体笔画特征

    HandwritingStrokeFeatures::equal

    automatically derived

    HandwritingStrokeFeatures::not_equal

    automatically derived

    HandwritingStrokeFeatures::to_repr

    automatically derived

    HandwritingStyle

    pub(all) enum HandwritingStyle {
    Print
    Cursive
    SemiCursive
    Block
    Unknown
    } derive(Eq,
    Debug
    )

    手写体类型 #non_exhaustive 表示未来可能添加新构造器

    HandwritingStyle::equal

    automatically derived

    HandwritingStyle::not_equal

    fn HandwritingStyle::not_equal(x : HandwritingStyle, y : HandwritingStyle) -> Bool
    automatically derived

    HandwritingStyle::to_repr

    automatically derived

    HandwritingTemplate

    pub(all) struct HandwritingTemplate {
    char : String
    style : HandwritingStyle
    features : HandwritingCharFeature
    sample_count : Int
    avg_accuracy : Double
    } derive(Eq,
    Debug
    )

    手写字体模板

    HandwritingTemplate::equal

    automatically derived

    HandwritingTemplate::not_equal

    automatically derived

    HandwritingTemplate::to_repr

    automatically derived

    HogFeatures

    pub(all) struct HogFeatures {
    features : Array[Double]
    cell_size : Int
    num_bins : Int
    width : Int
    height : Int
    } derive(Eq,
    Debug
    )

    HOG 特征描述子

    HogFeatures::equal

    fn HogFeatures::equal(HogFeatures, HogFeatures) -> Bool
    automatically derived

    HogFeatures::not_equal

    fn HogFeatures::not_equal(x : HogFeatures, y : HogFeatures) -> Bool
    automatically derived

    HogFeatures::to_repr

    automatically derived

    KnnClassifier

    pub(all) struct KnnClassifier {
    samples : Array[TrainingSample]
    k : Int
    distance_metric : String
    } derive(Eq,
    Debug
    )

    KNN 分类器

    KnnClassifier::equal

    automatically derived

    KnnClassifier::not_equal

    fn KnnClassifier::not_equal(x : KnnClassifier, y : KnnClassifier) -> Bool
    automatically derived

    KnnClassifier::to_repr

    automatically derived

    LRSchedulerConfig

    pub(all) struct LRSchedulerConfig {
    scheduler_type : LRSchedulerType
    initial_lr : Double
    min_lr : Double
    decay_rate : Double
    decay_steps : Int
    warmup_steps : Int
    patience : Int
    factor : Double
    } derive(Eq,
    Debug
    )

    学习率调度器配置

    LRSchedulerConfig::equal

    automatically derived

    LRSchedulerConfig::not_equal

    fn LRSchedulerConfig::not_equal(x : LRSchedulerConfig, y : LRSchedulerConfig) -> Bool
    automatically derived

    LRSchedulerConfig::to_repr

    automatically derived

    LRSchedulerType

    pub(all) enum LRSchedulerType {
    Constant
    StepDecay
    ExponentialDecay
    CosineAnnealing
    WarmupCosine
    ReduceOnPlateau
    } derive(Eq,
    Debug
    )

    学习率调度器类型 #non_exhaustive 表示未来可能添加新构造器

    LRSchedulerType::equal

    automatically derived

    LRSchedulerType::not_equal

    fn LRSchedulerType::not_equal(x : LRSchedulerType, y : LRSchedulerType) -> Bool
    automatically derived

    LRSchedulerType::to_repr

    automatically derived

    LanguageDetectionResult

    pub(all) struct LanguageDetectionResult {
    language : String
    confidence : Double
    probabilities : Array[(String, Double)]
    } derive(Eq,
    Debug
    )

    语言检测结果

    LanguageDetectionResult::equal

    automatically derived

    LanguageDetectionResult::not_equal

    automatically derived

    LanguageDetectionResult::to_repr

    automatically derived

    LanguageModelState

    pub(all) struct LanguageModelState {
    dictionary : Array[DictionaryEntry]
    common_errors : Array[CommonErrorPattern]
    similar_chars : Array[SimilarCharMapping]
    total_words : Int
    total_corrections : Int
    } derive(Eq,
    Debug
    )

    语言模型状态

    LanguageModelState::equal

    automatically derived

    LanguageModelState::not_equal

    automatically derived

    LanguageModelState::to_repr

    automatically derived

    LanguageType

    pub(all) enum LanguageType {
    Chinese
    English
    Digit
    Punctuation
    Mixed
    Unknown
    } derive(Eq,
    Debug
    )

    语言类型 #non_exhaustive 表示未来可能添加新构造器

    LanguageType::equal

    automatically derived

    LanguageType::not_equal

    fn LanguageType::not_equal(x : LanguageType, y : LanguageType) -> Bool
    automatically derived

    LanguageType::to_repr

    automatically derived

    LayoutType

    pub(all) enum LayoutType {
    SingleColumn
    DoubleColumn
    TripleColumn
    MixedLayout
    UnknownLayout
    } derive(Eq,
    Debug
    )

    布局类型 #non_exhaustive 表示未来可能添加新构造器

    LayoutType::equal

    fn LayoutType::equal(LayoutType, LayoutType) -> Bool
    automatically derived

    LayoutType::not_equal

    fn LayoutType::not_equal(x : LayoutType, y : LayoutType) -> Bool
    automatically derived

    LayoutType::to_repr

    automatically derived

    LbpFeatures

    pub(all) struct LbpFeatures {
    features : Array[Double]
    num_bins : Int
    radius : Int
    num_points : Int
    } derive(Eq,
    Debug
    )

    LBP 特征描述子

    LbpFeatures::equal

    fn LbpFeatures::equal(LbpFeatures, LbpFeatures) -> Bool
    automatically derived

    LbpFeatures::not_equal

    fn LbpFeatures::not_equal(x : LbpFeatures, y : LbpFeatures) -> Bool
    automatically derived

    LbpFeatures::to_repr

    automatically derived

    ListItemInfo

    pub(all) struct ListItemInfo {
    item_type : ListItemType
    marker : String
    level : Int
    number : Int
    } derive(Eq,
    Debug
    )

    列表项

    ListItemInfo::equal

    automatically derived

    ListItemInfo::not_equal

    fn ListItemInfo::not_equal(x : ListItemInfo, y : ListItemInfo) -> Bool
    automatically derived

    ListItemInfo::to_repr

    automatically derived

    ListItemType

    pub(all) enum ListItemType {
    Bullet
    Numbered
    Lettered
    Roman
    Checkbox
    None
    } derive(Eq,
    Debug
    )

    列表项类型 #non_exhaustive 表示未来可能添加新构造器

    ListItemType::equal

    automatically derived

    ListItemType::not_equal

    fn ListItemType::not_equal(x : ListItemType, y : ListItemType) -> Bool
    automatically derived

    ListItemType::to_repr

    automatically derived

    MarkdownDocument

    pub(all) struct MarkdownDocument {
    title : String
    elements : Array[MarkdownElement]
    tables : Array[MarkdownTable]
    images : Array[MarkdownImage]
    symbols : Array[MarkdownSymbol]
    reading_order : Array[Int]
    } derive(Eq,
    Debug
    )

    完整 Markdown 文档

    MarkdownDocument::equal

    automatically derived

    MarkdownDocument::not_equal

    fn MarkdownDocument::not_equal(x : MarkdownDocument, y : MarkdownDocument) -> Bool
    automatically derived

    MarkdownDocument::to_repr

    automatically derived

    MarkdownElement

    pub(all) struct MarkdownElement {
    element_type : MarkdownElementType
    x : Int
    y : Int
    width : Int
    height : Int
    content : String
    confidence : Double
    } derive(Eq,
    Debug
    )

    Markdown 元素

    MarkdownElement::equal

    automatically derived

    MarkdownElement::not_equal

    fn MarkdownElement::not_equal(x : MarkdownElement, y : MarkdownElement) -> Bool
    automatically derived

    MarkdownElement::to_repr

    automatically derived

    MarkdownElementType

    pub(all) enum MarkdownElementType {
    Title
    Heading1
    Heading2
    Heading3
    Paragraph
    ListItem
    Table
    Image
    Quote
    CodeBlock
    HorizontalRule
    PageBreak
    Unknown
    } derive(Eq,
    Debug
    )

    Markdown 元素类型 #non_exhaustive 表示未来可能添加新构造器

    MarkdownElementType::equal

    automatically derived

    MarkdownElementType::not_equal

    automatically derived

    MarkdownElementType::to_repr

    automatically derived

    MarkdownImage

    pub(all) struct MarkdownImage {
    x : Int
    y : Int
    width : Int
    height : Int
    image_type : String
    confidence : Double
    } derive(Eq,
    Debug
    )

    图片区域

    MarkdownImage::equal

    automatically derived

    MarkdownImage::not_equal

    fn MarkdownImage::not_equal(x : MarkdownImage, y : MarkdownImage) -> Bool
    automatically derived

    MarkdownImage::to_repr

    automatically derived

    MarkdownSymbol

    pub(all) struct MarkdownSymbol {
    symbol : String
    unicode : String
    category : String
    x : Int
    y : Int
    confidence : Double
    } derive(Eq,
    Debug
    )

    符号识别结果

    MarkdownSymbol::equal

    automatically derived

    MarkdownSymbol::not_equal

    fn MarkdownSymbol::not_equal(x : MarkdownSymbol, y : MarkdownSymbol) -> Bool
    automatically derived

    MarkdownSymbol::to_repr

    automatically derived

    MarkdownTable

    pub(all) struct MarkdownTable {
    rows : Int
    cols : Int
    cells : Array[Array[String]]
    has_header : Bool
    } derive(Eq,
    Debug
    )

    表格数据

    MarkdownTable::equal

    automatically derived

    MarkdownTable::not_equal

    fn MarkdownTable::not_equal(x : MarkdownTable, y : MarkdownTable) -> Bool
    automatically derived

    MarkdownTable::to_repr

    automatically derived

    MemoryUsageStats

    pub(all) struct MemoryUsageStats {
    current_usage_mb : Double
    peak_usage_mb : Double
    average_usage_mb : Double
    total_allocated : Int
    total_freed : Int
    gc_count : Int
    } derive(Eq,
    Debug
    )

    内存使用统计

    MemoryUsageStats::equal

    automatically derived

    MemoryUsageStats::not_equal

    fn MemoryUsageStats::not_equal(x : MemoryUsageStats, y : MemoryUsageStats) -> Bool
    automatically derived

    MemoryUsageStats::to_repr

    automatically derived

    ModelPackageConfig

    pub(all) struct ModelPackageConfig {
    model_name : String
    version : String
    model_path : String
    labels_path : String
    input_width : Int
    input_height : Int
    num_classes : Int
    compression : String
    } derive(Eq,
    Debug
    )

    模型打包配置

    ModelPackageConfig::equal

    automatically derived

    ModelPackageConfig::not_equal

    automatically derived

    ModelPackageConfig::to_repr

    automatically derived

    MultilingualOcrConfig

    pub(all) struct MultilingualOcrConfig {
    enable_chinese : Bool
    enable_english : Bool
    enable_digits : Bool
    enable_punctuation : Bool
    target_size : Int
    distance_metric : String
    auto_language_detection : Bool
    } derive(Eq,
    Debug
    )

    多语言识别配置

    MultilingualOcrConfig::equal

    automatically derived

    MultilingualOcrConfig::not_equal

    automatically derived

    MultilingualOcrConfig::to_repr

    automatically derived

    MultilingualOcrEnhancedConfig

    pub(all) struct MultilingualOcrEnhancedConfig {
    enable_chinese : Bool
    enable_english : Bool
    enable_digits : Bool
    enable_punctuation : Bool
    enable_japanese : Bool
    enable_korean : Bool
    target_size : Int
    distance_metric : String
    auto_language_detection : Bool
    smart_spacing : Bool
    punctuation_normalization : Bool
    use_language_model : Bool
    } derive(Eq,
    Debug
    )

    增强多语言识别配置

    MultilingualOcrEnhancedConfig::equal

    automatically derived

    MultilingualOcrEnhancedConfig::not_equal

    automatically derived

    MultilingualOcrEnhancedConfig::to_repr

    automatically derived

    NgramModel

    pub(all) struct NgramModel {
    n : Int
    bigram_counts : Array[(String, Int)]
    unigram_counts : Array[(String, Int)]
    } derive(Eq,
    Debug
    )

    N-gram 语言模型

    NgramModel::equal

    fn NgramModel::equal(NgramModel, NgramModel) -> Bool
    automatically derived

    NgramModel::not_equal

    fn NgramModel::not_equal(x : NgramModel, y : NgramModel) -> Bool
    automatically derived

    NgramModel::to_repr

    automatically derived

    OCRPageResult

    pub(all) struct OCRPageResult {
    page_number : Int
    width : Int
    height : Int
    blocks : Array[TextBlock]
    full_text : String
    average_confidence : Double
    processing_time_ms : Double
    } derive(Eq,
    Debug
    )

    OCR 页面结果

    OCRPageResult::equal

    automatically derived

    OCRPageResult::not_equal

    fn OCRPageResult::not_equal(x : OCRPageResult, y : OCRPageResult) -> Bool
    automatically derived

    OCRPageResult::to_repr

    automatically derived

    OcrAccuracyEnhancedConfig

    pub(all) struct OcrAccuracyEnhancedConfig {
    use_zernike_moments : Bool
    use_gabor_features : Bool
    use_directional_features : Bool
    use_weighted_knn : Bool
    use_confidence_calibration : Bool
    use_multi_scale : Bool
    knn_k : Int
    scales : Array[Int]
    } derive(Eq,
    Debug
    )

    准确率提升配置

    OcrAccuracyEnhancedConfig::equal

    automatically derived

    OcrAccuracyEnhancedConfig::not_equal

    automatically derived

    OcrAccuracyEnhancedConfig::to_repr

    automatically derived

    OcrCharResult

    pub(all) struct OcrCharResult {
    char : String
    confidence : Double
    x : Int
    y : Int
    width : Int
    height : Int
    } derive(Eq,
    Debug
    )

    单个字符识别结果

    OcrCharResult::equal

    automatically derived

    OcrCharResult::not_equal

    fn OcrCharResult::not_equal(x : OcrCharResult, y : OcrCharResult) -> Bool
    automatically derived

    OcrCharResult::to_repr

    automatically derived

    OcrConnectedComponent

    pub(all) struct OcrConnectedComponent {
    label : Int
    x : Int
    y : Int
    width : Int
    height : Int
    area : Int
    pixel_count : Int
    bounding_box : (Int, Int, Int, Int)
    centroid : (Double, Double)
    } derive(Eq,
    Debug
    )

    连通域结构体

    OcrConnectedComponent::equal

    automatically derived

    OcrConnectedComponent::not_equal

    automatically derived

    OcrConnectedComponent::to_repr

    automatically derived

    OcrConnectedComponentsResult

    pub(all) struct OcrConnectedComponentsResult {
    labels : Array[Int]
    num_components : Int
    components : Array[OcrConnectedComponent]
    } derive(Eq,
    Debug
    )

    连通域标记结果

    OcrConnectedComponentsResult::equal

    automatically derived

    OcrConnectedComponentsResult::not_equal

    automatically derived

    OcrConnectedComponentsResult::to_repr

    automatically derived

    OcrErrorType

    pub(all) enum OcrErrorType {
    Substitution
    Insertion
    Deletion
    Reorder
    Unknown
    } derive(Eq,
    Debug
    )

    错误类型 #non_exhaustive 表示未来可能添加新构造器

    OcrErrorType::equal

    automatically derived

    OcrErrorType::not_equal

    fn OcrErrorType::not_equal(x : OcrErrorType, y : OcrErrorType) -> Bool
    automatically derived

    OcrErrorType::to_repr

    automatically derived

    OcrResult

    pub(all) struct OcrResult {
    text : String
    confidence : Double
    characters : Array[OcrCharResult]
    } derive(Eq,
    Debug
    )

    OCR 识别结果结构体

    OcrResult::equal

    fn OcrResult::equal(OcrResult, OcrResult) -> Bool
    automatically derived

    OcrResult::not_equal

    fn OcrResult::not_equal(x : OcrResult, y : OcrResult) -> Bool
    automatically derived

    OcrResult::to_repr

    automatically derived

    OptimizerConfig

    pub(all) struct OptimizerConfig {
    optimizer_type : OptimizerType
    learning_rate : Double
    momentum : Double
    beta1 : Double
    beta2 : Double
    epsilon : Double
    weight_decay : Double
    grad_clip : Double
    } derive(Eq,
    Debug
    )

    优化器配置

    OptimizerConfig::equal

    automatically derived

    OptimizerConfig::not_equal

    fn OptimizerConfig::not_equal(x : OptimizerConfig, y : OptimizerConfig) -> Bool
    automatically derived

    OptimizerConfig::to_repr

    automatically derived

    OptimizerType

    pub(all) enum OptimizerType {
    SGD
    Momentum
    Adam
    RMSprop
    Adagrad
    } derive(Eq,
    Debug
    )

    优化器类型 #non_exhaustive 表示未来可能添加新构造器

    OptimizerType::equal

    automatically derived

    OptimizerType::not_equal

    fn OptimizerType::not_equal(x : OptimizerType, y : OptimizerType) -> Bool
    automatically derived

    OptimizerType::to_repr

    automatically derived

    PageRegion

    pub(all) struct PageRegion {
    region_type : PageRegionType
    x : Int
    y : Int
    width : Int
    height : Int
    confidence : Double
    } derive(Eq,
    Debug
    )

    页面区域

    PageRegion::equal

    fn PageRegion::equal(PageRegion, PageRegion) -> Bool
    automatically derived

    PageRegion::not_equal

    fn PageRegion::not_equal(x : PageRegion, y : PageRegion) -> Bool
    automatically derived

    PageRegion::to_repr

    automatically derived

    PageRegionType

    pub(all) enum PageRegionType {
    Header
    Footer
    Body
    Margin
    Gutter
    PageNumber
    } derive(Eq,
    Debug
    )

    页面区域类型 #non_exhaustive 表示未来可能添加新构造器

    PageRegionType::equal

    automatically derived

    PageRegionType::not_equal

    fn PageRegionType::not_equal(x : PageRegionType, y : PageRegionType) -> Bool
    automatically derived

    PageRegionType::to_repr

    automatically derived

    PerformanceBenchmark

    pub(all) struct PerformanceBenchmark {
    total_time_ms : Double
    preprocess_time_ms : Double
    layout_time_ms : Double
    recognition_time_ms : Double
    postprocess_time_ms : Double
    pages_per_second : Double
    chars_per_second : Double
    memory_usage_mb : Double
    cpu_usage_percent : Double
    } derive(Eq,
    Debug
    )

    性能基准结果

    PerformanceBenchmark::equal

    automatically derived

    PerformanceBenchmark::not_equal

    automatically derived

    PerformanceBenchmark::to_repr

    automatically derived

    PostProcessConfig

    pub(all) struct PostProcessConfig {
    use_dictionary : Bool
    use_ngram : Bool
    ngram_size : Int
    min_confidence : Double
    max_candidates : Int
    } derive(Eq,
    Debug
    )

    后处理配置

    PostProcessConfig::equal

    automatically derived

    PostProcessConfig::not_equal

    fn PostProcessConfig::not_equal(x : PostProcessConfig, y : PostProcessConfig) -> Bool
    automatically derived

    PostProcessConfig::to_repr

    automatically derived

    ProjectionFeatures

    pub(all) struct ProjectionFeatures {
    horizontal : Array[Double]
    vertical : Array[Double]
    horizontal_mean : Double
    horizontal_std : Double
    vertical_mean : Double
    vertical_std : Double
    } derive(Eq,
    Debug
    )

    投影特征

    ProjectionFeatures::equal

    automatically derived

    ProjectionFeatures::not_equal

    automatically derived

    ProjectionFeatures::to_repr

    automatically derived

    ProjectionResult

    pub(all) struct ProjectionResult {
    projection : Array[Int]
    peaks : Array[Int]
    valleys : Array[Int]
    mean : Double
    stddev : Double
    } derive(Eq,
    Debug
    )

    投影结果结构体

    ProjectionResult::equal

    automatically derived

    ProjectionResult::not_equal

    fn ProjectionResult::not_equal(x : ProjectionResult, y : ProjectionResult) -> Bool
    automatically derived

    ProjectionResult::to_repr

    automatically derived

    PunctuationTemplate

    pub(all) struct PunctuationTemplate {
    char : String
    features : Array[Double]
    width_ratio : Double
    } derive(Eq,
    Debug
    )

    标点符号模板

    PunctuationTemplate::equal

    automatically derived

    PunctuationTemplate::not_equal

    automatically derived

    PunctuationTemplate::to_repr

    automatically derived

    RobustnessReport

    pub(all) struct RobustnessReport {
    overall_score : Double
    quality_score : Double
    distortion_score : Double
    layout_complexity_score : Double
    noise_resistance_score : Double
    recommendations : Array[String]
    estimated_accuracy : Double
    processing_recommendation : String
    } derive(Eq,
    Debug
    )

    鲁棒性评估报告

    RobustnessReport::equal

    automatically derived

    RobustnessReport::not_equal

    fn RobustnessReport::not_equal(x : RobustnessReport, y : RobustnessReport) -> Bool
    automatically derived

    RobustnessReport::to_repr

    automatically derived

    ScanOCRConfig

    pub(all) struct ScanOCRConfig {
    language : String
    dpi : Int
    deskew : Bool
    denoise : Bool
    binarization_method : String
    layout_analysis : Bool
    confidence_threshold : Double
    } derive(Eq,
    Debug
    )

    扫描文档配置

    ScanOCRConfig::equal

    automatically derived

    ScanOCRConfig::not_equal

    fn ScanOCRConfig::not_equal(x : ScanOCRConfig, y : ScanOCRConfig) -> Bool
    automatically derived

    ScanOCRConfig::to_repr

    automatically derived

    ScanQuality

    pub(all) struct ScanQuality {
    brightness : Double
    contrast : Double
    sharpness : Double
    noise_level : Double
    skew_angle : Double
    overall_score : Double
    issues : Array[String]
    } derive(Eq,
    Debug
    )

    扫描质量评估结果

    ScanQuality::equal

    fn ScanQuality::equal(ScanQuality, ScanQuality) -> Bool
    automatically derived

    ScanQuality::not_equal

    fn ScanQuality::not_equal(x : ScanQuality, y : ScanQuality) -> Bool
    automatically derived

    ScanQuality::to_repr

    automatically derived

    ScanQualityLevel

    pub(all) enum ScanQualityLevel {
    Excellent
    Good
    Fair
    Poor
    VeryPoor
    } derive(Eq,
    Debug
    )

    扫描质量等级 #non_exhaustive 表示未来可能添加新构造器

    ScanQualityLevel::equal

    automatically derived

    ScanQualityLevel::not_equal

    fn ScanQualityLevel::not_equal(x : ScanQualityLevel, y : ScanQualityLevel) -> Bool
    automatically derived

    ScanQualityLevel::to_repr

    automatically derived

    SimilarCharMapping

    pub(all) struct SimilarCharMapping {
    char : String
    similar_chars : Array[String]
    context_hint : String
    } derive(Eq,
    Debug
    )

    相似字符映射

    SimilarCharMapping::equal

    automatically derived

    SimilarCharMapping::not_equal

    automatically derived

    SimilarCharMapping::to_repr

    automatically derived

    SplitPoint

    pub(all) struct SplitPoint {
    x : Int
    y_top : Int
    y_bottom : Int
    confidence : Double
    } derive(Eq,
    Debug
    )

    分割点结构体

    SplitPoint::equal

    fn SplitPoint::equal(SplitPoint, SplitPoint) -> Bool
    automatically derived

    SplitPoint::not_equal

    fn SplitPoint::not_equal(x : SplitPoint, y : SplitPoint) -> Bool
    automatically derived

    SplitPoint::to_repr

    automatically derived

    StatisticalFeatures

    pub(all) struct StatisticalFeatures {
    mean : Double
    std : Double
    skewness : Double
    kurtosis : Double
    entropy : Double
    energy : Double
    contrast : Double
    homogeneity : Double
    } derive(Eq,
    Debug
    )

    统计特征

    StatisticalFeatures::equal

    automatically derived

    StatisticalFeatures::not_equal

    automatically derived

    StatisticalFeatures::to_repr

    automatically derived

    StrokeFeature

    pub(all) struct StrokeFeature {
    stroke_type : StrokeType
    start_x : Double
    start_y : Double
    end_x : Double
    end_y : Double
    length : Double
    angle : Double
    curvature : Double
    pressure : Double
    } derive(Eq,
    Debug
    )

    笔画特征

    StrokeFeature::equal

    automatically derived

    StrokeFeature::not_equal

    fn StrokeFeature::not_equal(x : StrokeFeature, y : StrokeFeature) -> Bool
    automatically derived

    StrokeFeature::to_repr

    automatically derived

    StrokeSegmentationResult

    pub(all) struct StrokeSegmentationResult {
    num_strokes : Int
    strokes : Array[StrokeFeature]
    segmentation_points : Array[(Int, Int)]
    confidence : Double
    } derive(Eq,
    Debug
    )

    连笔分割结果

    StrokeSegmentationResult::equal

    automatically derived

    StrokeSegmentationResult::not_equal

    automatically derived

    StrokeSegmentationResult::to_repr

    automatically derived

    StrokeType

    pub(all) enum StrokeType {
    Horizontal
    Vertical
    LeftFalling
    RightFalling
    Dot
    Hook
    Turning
    Rising
    Unknown
    } derive(Eq,
    Debug
    )

    笔画类型 #non_exhaustive 表示未来可能添加新构造器

    StrokeType::equal

    fn StrokeType::equal(StrokeType, StrokeType) -> Bool
    automatically derived

    StrokeType::not_equal

    fn StrokeType::not_equal(x : StrokeType, y : StrokeType) -> Bool
    automatically derived

    StrokeType::to_repr

    automatically derived

    TableCell

    pub(all) struct TableCell {
    x : Int
    y : Int
    width : Int
    height : Int
    row : Int
    col : Int
    row_span : Int
    col_span : Int
    } derive(Eq,
    Debug
    )

    单元格结构体

    TableCell::equal

    fn TableCell::equal(TableCell, TableCell) -> Bool
    automatically derived

    TableCell::not_equal

    fn TableCell::not_equal(x : TableCell, y : TableCell) -> Bool
    automatically derived

    TableCell::to_repr

    automatically derived

    TableCellContent

    pub(all) struct TableCellContent {
    row : Int
    col : Int
    row_span : Int
    col_span : Int
    x : Int
    y : Int
    width : Int
    height : Int
    text : String
    is_header : Bool
    is_merged : Bool
    } derive(Eq,
    Debug
    )

    单元格内容

    TableCellContent::equal

    automatically derived

    TableCellContent::not_equal

    fn TableCellContent::not_equal(x : TableCellContent, y : TableCellContent) -> Bool
    automatically derived

    TableCellContent::to_repr

    automatically derived

    TableDetectionResult

    pub(all) struct TableDetectionResult {
    horizontal_lines : Array[(Int, Int, Int)]
    vertical_lines : Array[(Int, Int, Int)]
    intersections : Array[(Int, Int)]
    num_rows : Int
    num_cols : Int
    confidence : Double
    } derive(Eq,
    Debug
    )

    表格线检测结果

    TableDetectionResult::equal

    automatically derived

    TableDetectionResult::not_equal

    automatically derived

    TableDetectionResult::to_repr

    automatically derived

    TableLine

    pub(all) struct TableLine {
    x1 : Int
    y1 : Int
    x2 : Int
    y2 : Int
    line_type : TableLineType
    thickness : Int
    } derive(Eq,
    Debug
    )

    表格线结构体

    TableLine::equal

    fn TableLine::equal(TableLine, TableLine) -> Bool
    automatically derived

    TableLine::not_equal

    fn TableLine::not_equal(x : TableLine, y : TableLine) -> Bool
    automatically derived

    TableLine::to_repr

    automatically derived

    TableLineType

    pub(all) enum TableLineType {
    Horizontal
    Vertical
    } derive(Eq,
    Debug
    )

    表格线类型 #non_exhaustive 表示未来可能添加新构造器

    TableLineType::equal

    automatically derived

    TableLineType::not_equal

    fn TableLineType::not_equal(x : TableLineType, y : TableLineType) -> Bool
    automatically derived

    TableLineType::to_repr

    automatically derived

    TableStructure

    pub(all) struct TableStructure {
    rows : Int
    cols : Int
    cells : Array[TableCell]
    horizontal_lines : Array[TableLine]
    vertical_lines : Array[TableLine]
    bounding_box : (Int, Int, Int, Int)
    } derive(Eq,
    Debug
    )

    表格结构结构体

    TableStructure::equal

    automatically derived

    TableStructure::not_equal

    fn TableStructure::not_equal(x : TableStructure, y : TableStructure) -> Bool
    automatically derived

    TableStructure::to_repr

    automatically derived

    TemplateMatcher

    pub(all) struct TemplateMatcher {
    templates : Array[(String, Array[Double])]
    distance_metric : String
    } derive(Eq,
    Debug
    )

    模板匹配分类器

    TemplateMatcher::equal

    automatically derived

    TemplateMatcher::not_equal

    fn TemplateMatcher::not_equal(x : TemplateMatcher, y : TemplateMatcher) -> Bool
    automatically derived

    TemplateMatcher::to_repr

    automatically derived

    TextBlock

    pub(all) struct TextBlock {
    x : Int
    y : Int
    width : Int
    height : Int
    block_type : String
    text : String
    confidence : Double
    reading_order : Int
    } derive(Eq,
    Debug
    )

    文本块(版面分析结果)

    TextBlock::equal

    fn TextBlock::equal(TextBlock, TextBlock) -> Bool
    automatically derived

    TextBlock::not_equal

    fn TextBlock::not_equal(x : TextBlock, y : TextBlock) -> Bool
    automatically derived

    TextBlock::to_repr

    automatically derived

    TextLine

    pub(all) struct TextLine {
    x : Int
    y : Int
    width : Int
    height : Int
    } derive(Eq,
    Debug
    )

    文本行结构体

    TextLine::equal

    fn TextLine::equal(TextLine, TextLine) -> Bool
    automatically derived

    TextLine::not_equal

    fn TextLine::not_equal(x : TextLine, y : TextLine) -> Bool
    automatically derived

    TextLine::to_repr

    automatically derived

    TextLineAttributes

    pub(all) struct TextLineAttributes {
    x : Int
    y : Int
    width : Int
    height : Int
    font_size : Double
    font_weight : String
    is_indented : Bool
    indent_level : Int
    line_spacing : Double
    text : String
    alignment : String
    } derive(Eq,
    Debug
    )

    文本行属性

    TextLineAttributes::equal

    automatically derived

    TextLineAttributes::not_equal

    automatically derived

    TextLineAttributes::to_repr

    automatically derived

    TextLineInfo

    pub(all) struct TextLineInfo {
    y_start : Int
    y_end : Int
    height : Int
    x_start : Int
    x_end : Int
    width : Int
    pixel_count : Int
    baseline : Int
    } derive(Eq,
    Debug
    )

    文本行结构体

    TextLineInfo::equal

    automatically derived

    TextLineInfo::not_equal

    fn TextLineInfo::not_equal(x : TextLineInfo, y : TextLineInfo) -> Bool
    automatically derived

    TextLineInfo::to_repr

    automatically derived

    TextRegion

    pub(all) struct TextRegion {
    x : Int
    y : Int
    width : Int
    height : Int
    region_type : TextRegionType
    } derive(Eq,
    Debug
    )

    文本区域结构体

    TextRegion::equal

    fn TextRegion::equal(TextRegion, TextRegion) -> Bool
    automatically derived

    TextRegion::not_equal

    fn TextRegion::not_equal(x : TextRegion, y : TextRegion) -> Bool
    automatically derived

    TextRegion::to_repr

    automatically derived

    TextRegionType

    pub(all) enum TextRegionType {
    Text
    Image
    Table
    Unknown
    } derive(Eq,
    Debug
    )

    文本区域类型 #non_exhaustive 表示未来可能添加新构造器

    TextRegionType::equal

    automatically derived

    TextRegionType::not_equal

    fn TextRegionType::not_equal(x : TextRegionType, y : TextRegionType) -> Bool
    automatically derived

    TextRegionType::to_repr

    automatically derived

    TrainingConfig

    pub(all) struct TrainingConfig {
    epochs : Int
    batch_size : Int
    optimizer : OptimizerConfig
    lr_scheduler : LRSchedulerConfig
    augmentation : AugmentationConfig
    early_stopping_patience : Int
    early_stopping_min_delta : Double
    save_best_only : Bool
    checkpoint_interval : Int
    log_interval : Int
    validation_split : Double
    shuffle : Bool
    random_seed : Int
    } derive(Eq,
    Debug
    )

    训练配置

    TrainingConfig::equal

    automatically derived

    TrainingConfig::not_equal

    fn TrainingConfig::not_equal(x : TrainingConfig, y : TrainingConfig) -> Bool
    automatically derived

    TrainingConfig::to_repr

    automatically derived

    TrainingDataset

    pub(all) struct TrainingDataset {
    samples : Array[TrainingSample]
    labels : Array[String]
    num_samples : Int
    num_classes : Int
    } derive(Eq,
    Debug
    )

    训练样本数据集

    TrainingDataset::equal

    automatically derived

    TrainingDataset::not_equal

    fn TrainingDataset::not_equal(x : TrainingDataset, y : TrainingDataset) -> Bool
    automatically derived

    TrainingDataset::to_repr

    automatically derived

    TrainingMetrics

    pub(all) struct TrainingMetrics {
    epoch : Int
    train_loss : Double
    train_accuracy : Double
    val_loss : Double
    val_accuracy : Double
    learning_rate : Double
    time_ms : Double
    is_best : Bool
    } derive(Eq,
    Debug
    )

    训练指标

    TrainingMetrics::equal

    automatically derived

    TrainingMetrics::not_equal

    fn TrainingMetrics::not_equal(x : TrainingMetrics, y : TrainingMetrics) -> Bool
    automatically derived

    TrainingMetrics::to_repr

    automatically derived

    TrainingSample

    pub(all) struct TrainingSample {
    features : Array[Double]
    label : String
    } derive(Eq,
    Debug
    )

    训练样本结构体

    TrainingSample::equal

    automatically derived

    TrainingSample::not_equal

    fn TrainingSample::not_equal(x : TrainingSample, y : TrainingSample) -> Bool
    automatically derived

    TrainingSample::to_repr

    automatically derived

    TrainingState

    pub(all) struct TrainingState {
    current_epoch : Int
    best_val_accuracy : Double
    best_epoch : Int
    epochs_without_improvement : Int
    total_training_time_ms : Double
    history : Array[TrainingMetrics]
    is_completed : Bool
    stop_reason : String
    } derive(Eq,
    Debug
    )

    训练状态

    TrainingState::equal

    automatically derived

    TrainingState::not_equal

    fn TrainingState::not_equal(x : TrainingState, y : TrainingState) -> Bool
    automatically derived

    TrainingState::to_repr

    automatically derived

    adaptive_threshold_ocr

    fn adaptive_threshold_ocr(img :
    core
    /types.Image, block_size? : Int, c? : Int) ->
    core
    /types.Image raise
    core
    /types.LoadError

    OCR 专用自适应阈值(结合全局阈值和局部阈值) 适用于光照不均匀的文档图像

    advanced_chinese_ocr_default_config

    fn advanced_chinese_ocr_default_config() -> AdvancedChineseOcrConfig

    创建默认完善中文 OCR 配置

    analyze_complex_layout

    fn analyze_complex_layout(text_blocks : Array[TextBlock], page_width : Int, page_height : Int) -> ComplexLayoutAnalysis

    分析复杂版面

    analyze_document_layout

    fn analyze_document_layout(img :
    core
    /types.Image) -> DocumentStructure raise
    core
    /types.LoadError

    分析文档版面(检测文本块、分类元素类型)

    analyze_layout_enhanced

    fn analyze_layout_enhanced(img :
    core
    /types.Image, config? : DocumentUnderstandingEnhancedConfig) -> Array[DocumentBlock] raise
    core
    /types.LoadError

    增强版面分析(基于连通域的文本块检测)

    analyze_layout_scan

    fn analyze_layout_scan(binary_img :
    core
    /types.Image) -> Array[TextBlock] raise
    core
    /types.LoadError

    版面分析(基于投影的文本块检测)

    analyze_markdown_element_distribution

    fn analyze_markdown_element_distribution(doc : MarkdownDocument) -> Array[(String, Int)]

    统计文档元素类型分布

    analyze_table_results

    fn analyze_table_results(tables : Array[EnhancedTableResult]) -> Array[(String, Int)]

    统计表格识别结果

    analyze_table_structure

    fn analyze_table_structure(horizontal_lines : Array[TableLine], vertical_lines : Array[TableLine]) -> TableStructure raise
    core
    /types.LoadError

    分析表格结构(基于水平线和垂直线)

    apply_augmentation

    fn apply_augmentation(sample : DLTrainingSample, config : AugmentationConfig) -> DLTrainingSample

    应用数据增强

    augment_features

    fn augment_features(features : Array[Double], noise_level? : Double) -> Array[Double]

    特征增广(添加噪声、缩放、平移)

    augment_random_noise

    fn augment_random_noise(sample : DLTrainingSample, noise_level : Double) -> DLTrainingSample

    数据增强:随机噪声

    augment_random_rotation

    fn augment_random_rotation(sample : DLTrainingSample, angle_range : Double) -> DLTrainingSample

    数据增强:随机旋转

    augment_random_scale

    fn augment_random_scale(sample : DLTrainingSample, scale_range : Double) -> DLTrainingSample

    数据增强:随机缩放

    augment_random_shift

    fn augment_random_shift(sample : DLTrainingSample, shift_range : Double) -> DLTrainingSample

    数据增强:随机平移

    background_normalization

    fn background_normalization(img :
    core
    /types.Image, kernel_size? : Int) ->
    core
    /types.Image raise
    core
    /types.LoadError

    背景归一化(将背景统一为白色) 适用于背景不均匀的文档图像

    batch_correct_texts

    fn batch_correct_texts(texts : Array[String], context_type? : String) -> Array[CorrectionResult] raise
    core
    /types.LoadError

    批量文本纠错

    batch_recognize_chars

    fn batch_recognize_chars(images : Array[
    core
    /types.Image], config : DLCnnModelConfig, labels : Array[String]) -> Array[DLInferenceResult] raise
    core
    /types.LoadError

    批量字符识别优化(减少重复计算)

    batch_scan_ocr

    fn batch_scan_ocr(images : Array[
    core
    /types.Image], config : ScanOCRConfig) -> Array[OCRPageResult] raise
    core
    /types.LoadError

    批量扫描文档 OCR

    batch_summary_to_string

    fn batch_summary_to_string(summary : BatchResultSummary) -> String

    生成批处理报告

    build_document_structure_tree

    fn build_document_structure_tree(blocks : Array[DocumentBlock]) -> Array[DocumentTreeNode]

    构建文档结构树(层级结构)

    build_enhanced_elements

    fn build_enhanced_elements(lines : Array[TextLineAttributes], page_width : Int, page_height : Int) -> EnhancedDocument raise
    core
    /types.LoadError

    从文本行构建增强版文档元素

    build_gaussian_kernel_lut

    fn build_gaussian_kernel_lut(sigma : Double, radius : Int) -> Array[Double] raise
    core
    /types.LoadError

    预计算高斯核查找表

    build_grayscale_lut

    fn build_grayscale_lut() -> Array[Int]

    预计算灰度查找表(0-255 映射)

    build_markdown_document

    fn build_markdown_document(ocr_result : OCRPageResult, title? : String) -> MarkdownDocument raise
    core
    /types.LoadError

    从 OCR 结果构建 Markdown 文档

    build_threshold_lut

    fn build_threshold_lut(threshold : Int) -> Array[Int]

    预计算二值化查找表

    cache_friendly_horizontal_projection

    fn cache_friendly_horizontal_projection(img :
    core
    /types.Image) -> Array[Int] raise
    core
    /types.LoadError

    缓存友好的水平投影计算(按行连续访问)

    cache_friendly_vertical_projection

    fn cache_friendly_vertical_projection(img :
    core
    /types.Image) -> Array[Int] raise
    core
    /types.LoadError

    缓存友好的垂直投影计算(转置后按行访问)

    calculate_accuracy

    fn calculate_accuracy(predictions : Array[Int], labels : Array[Int]) -> Double

    计算准确率

    calculate_accuracy_improvement

    fn calculate_accuracy_improvement(before_results : Array[CorrectionResult], expected_texts : Array[String]) -> (Double, Double, Double)

    计算纠错前后准确率提升

    calculate_accuracy_stats

    fn calculate_accuracy_stats(expected_lines : Array[String], actual_lines : Array[String]) -> AccuracyStats raise
    core
    /types.LoadError

    计算完整准确率统计

    calculate_batch_progress

    fn calculate_batch_progress(tasks : Array[BatchTask], elapsed_time_ms : Double) -> BatchProgress raise
    core
    /types.LoadError

    计算批处理进度

    calculate_char_accuracy

    fn calculate_char_accuracy(expected : String, actual : String) -> Double

    计算字符级准确率

    calculate_chinese_similarity

    fn calculate_chinese_similarity(char1 : DictCharEntry, char2 : DictCharEntry) -> Double

    计算两个汉字的结构相似度

    calculate_edit_distance

    fn calculate_edit_distance(s1 : String, s2 : String) -> Int

    计算编辑距离(Levenshtein)

    calculate_learning_rate

    fn calculate_learning_rate(config : LRSchedulerConfig, epoch : Int, current_lr : Double, val_loss : Double) -> Double raise
    core
    /types.LoadError

    计算学习率

    calculate_word_accuracy

    fn calculate_word_accuracy(expected : String, actual : String) -> Double

    计算词级准确率

    calibrate_confidence

    #deprecated("Use calibrate_confidence_enhanced instead")
    fn calibrate_confidence(result : OcrResult, factor? : Double) -> OcrResult raise
    core
    /types.LoadError

    置信度校准 @deprecated 已废弃,请使用 calibrate_confidence_enhanced 代替

    calibrate_confidence_enhanced

    fn calibrate_confidence_enhanced(raw_confidence : Double, distance_distribution : Array[Double]) -> Double

    置信度校准(基于距离分布的 Platt 缩放简化版)

    chebyshev_distance

    fn chebyshev_distance(a : Array[Double], b : Array[Double]) -> Double raise
    core
    /types.LoadError

    计算切比雪夫距离

    check_accuracy_threshold

    fn check_accuracy_threshold(stats : AccuracyStats, min_char_accuracy? : Double, min_word_accuracy? : Double, min_f1_score? : Double) -> (Bool, Array[String]) raise
    core
    /types.LoadError

    验证准确率是否达标

    check_early_stopping

    fn check_early_stopping(state : TrainingState, config : TrainingConfig, current_val_accuracy : Double) -> (Bool, TrainingState)

    早停检查

    chinese_ocr_default_config

    fn chinese_ocr_default_config() -> ChineseOcrConfig

    创建默认中文 OCR 配置

    classify_markdown_element

    fn classify_markdown_element(block : TextBlock, avg_font_size? : Double) -> MarkdownElementType

    分类 Markdown 元素类型

    cnn_confusion_matrix

    fn cnn_confusion_matrix(test_samples : Array[DLTrainingSample], config : DLCnnModelConfig, labels : Array[String]) -> Array[Array[Int]] raise
    core
    /types.LoadError

    计算混淆矩阵

    cnn_infer

    fn cnn_infer(image_data : Array[Double], config : DLCnnModelConfig, labels : Array[String]) -> DLInferenceResult

    CNN 推理(简化版)

    cnn_recognize_char

    fn cnn_recognize_char(img :
    core
    /types.Image, config : DLCnnModelConfig, labels : Array[String]) -> DLInferenceResult raise
    core
    /types.LoadError

    CNN 字符识别:输入图像,返回识别结果

    cnn_recognize_digits

    fn cnn_recognize_digits(img :
    core
    /types.Image, config : DLCnnModelConfig) -> DLInferenceResult raise
    core
    /types.LoadError

    CNN 数字识别

    cnn_recognize_letters

    fn cnn_recognize_letters(img :
    core
    /types.Image, config : DLCnnModelConfig) -> DLInferenceResult raise
    core
    /types.LoadError

    CNN 字母识别

    cnn_train

    fn cnn_train(samples : Array[DLTrainingSample], conv_weights : Array[Double], conv_bias : Array[Double], dense_weights : Array[Double], dense_bias : Array[Double], in_h : Int, in_w : Int, in_c : Int, conv_out_c : Int, k_size : Int, num_classes : Int, learning_rate : Double, epochs : Int) -> (Array[Double], Array[Double], Array[Double], Array[Double], Array[DLTrainingHistory]) raise
    core
    /types.LoadError

    CNN 完整训练:多 epoch 训练

    cnn_train_step

    fn cnn_train_step(input : Array[Double], target : Int, conv_weights : Array[Double], conv_bias : Array[Double], dense_weights : Array[Double], dense_bias : Array[Double], in_h : Int, in_w : Int, in_c : Int, conv_out_c : Int, k_size : Int, num_classes : Int, learning_rate : Double) -> (Array[Double], Array[Double], Array[Double], Array[Double], Double) raise
    core
    /types.LoadError

    CNN 单步训练

    combined_features

    fn combined_features(img :
    core
    /types.Image) -> Array[Double] raise
    core
    /types.LoadError

    组合特征(将多种特征拼接成一个向量)

    complete_char_segmentation

    fn complete_char_segmentation(img :
    core
    /types.Image, min_char_width? : Int, max_char_width? : Int) -> Array[(Int, Int, Int, Int)] raise
    core
    /types.LoadError

    完整字符分割流水线
    1. 连通域初步分割
    2. 粘连字符检测
    3. 滴水算法分割粘连字符
    4. 后处理(合并过小、过滤噪声)

    compute_confusion_matrix

    fn compute_confusion_matrix(predictions : Array[Int], labels : Array[Int], num_classes : Int) -> Array[Array[Int]]

    混淆矩阵计算

    compute_distance

    fn compute_distance(a : Array[Double], b : Array[Double], metric : DistanceMetric) -> Double raise
    core
    /types.LoadError

    计算距离(根据度量类型)

    compute_per_class_accuracy

    fn compute_per_class_accuracy(confusion_matrix : Array[Array[Int]]) -> Array[Double]

    计算每类准确率

    compute_reading_order

    fn compute_reading_order(elements : Array[DocumentElement]) -> Array[Int] raise
    core
    /types.LoadError

    计算阅读顺序(从上到下,从左到右)

    connected_components_analysis

    fn connected_components_analysis(img :
    core
    /types.Image, connectivity? : Int) -> OcrConnectedComponentsResult raise
    core
    /types.LoadError

    二值图像连通域标记(4邻域或8邻域) 使用两遍扫描算法

    conv2d

    fn conv2d(input : Array[Double], in_h : Int, in_w : Int, in_c : Int, kernel : Array[Double], out_c : Int, k_size : Int, stride : Int, padding : Int) -> Array[Double] raise
    core
    /types.LoadError

    2D 卷积操作(简化版)

    correct_common_patterns

    fn correct_common_patterns(text : String) -> CorrectionResult

    基于常见错误模式的纠错

    correct_similar_chars

    fn correct_similar_chars(text : String, context_type : String) -> CorrectionResult raise
    core
    /types.LoadError

    基于相似字符的单字符纠错

    correct_slant

    fn correct_slant(img :
    core
    /types.Image, max_slant? : Double) ->
    core
    /types.Image raise
    core
    /types.LoadError

    倾斜校正(手写体专用)

    cosine_distance

    fn cosine_distance(a : Array[Double], b : Array[Double]) -> Double raise
    core
    /types.LoadError

    计算余弦相似度(返回距离 = 1 - 相似度)

    cosine_similarity

    fn cosine_similarity(feat1 : Array[Double], feat2 : Array[Double]) -> Double

    计算特征余弦相似度

    create_batch_tasks

    fn create_batch_tasks(input_files : Array[String], output_directory : String, output_format : String) -> Array[BatchTask] raise
    core
    /types.LoadError

    创建批处理任务列表

    create_data_loader

    fn create_data_loader(samples : Array[DLTrainingSample], batch_size : Int, shuffle : Bool) -> DataLoader raise
    core
    /types.LoadError

    创建数据加载器

    create_default_api_server_config

    fn create_default_api_server_config() -> ApiServerConfig

    创建默认 API Server 配置

    create_default_batch_config

    fn create_default_batch_config() -> BatchOcrConfig

    创建默认批处理配置

    create_default_char_cnn_config

    fn create_default_char_cnn_config(num_classes : Int) -> DLCnnModelConfig

    创建默认 CNN 模型配置(用于字符识别)

    create_default_chinese_dictionary

    fn create_default_chinese_dictionary() -> DictChineseDict

    创建默认中文字库(高频 20 字 + 可扩展)

    create_default_cli_config

    fn create_default_cli_config() -> CliConfig

    创建默认 CLI 配置

    create_default_docker_config

    fn create_default_docker_config() -> DockerConfig

    创建默认 Docker 配置

    create_default_handwriting_config

    fn create_default_handwriting_config() -> HandwritingRecognitionConfig

    创建默认手写识别配置

    create_default_language_model

    fn create_default_language_model() -> LanguageModelState

    创建默认语言模型

    create_default_model_package_config

    fn create_default_model_package_config() -> ModelPackageConfig

    创建默认模型打包配置

    create_default_training_config

    fn create_default_training_config() -> TrainingConfig

    创建默认训练配置

    create_feature_extractor

    fn create_feature_extractor(model_name : String, feature_dim : Int) -> DLFeatureExtractor

    创建特征提取器

    create_handwriting_template

    fn create_handwriting_template(char : String, style : HandwritingStyle, samples : Array[
    core
    /types.Image]) -> HandwritingTemplate raise
    core
    /types.LoadError

    创建手写字体模板

    create_neural_layer

    fn create_neural_layer(layer_type : DLLayerType, name : String, input_shape : Array[Int]) -> DLNeuralLayer

    创建神经网络层

    create_training_history

    fn create_training_history(epoch : Int, train_loss : Double, train_accuracy : Double, val_loss : Double, val_accuracy : Double, learning_rate : Double, time_ms : Double) -> DLTrainingHistory

    训练历史记录

    create_training_sample

    fn create_training_sample(img :
    core
    /types.Image, label : Int, label_text : String) -> DLTrainingSample raise
    core
    /types.LoadError

    创建训练样本

    create_training_state

    fn create_training_state() -> TrainingState

    创建训练状态

    cross_entropy_loss

    fn cross_entropy_loss(predicted : Array[Double], target : Int) -> Double

    计算交叉熵损失

    dataset_add_sample

    fn dataset_add_sample(dataset : TrainingDataset, features : Array[Double], label : String) -> TrainingDataset

    添加样本到数据集

    dataset_create

    fn dataset_create() -> TrainingDataset

    创建空训练数据集

    dataset_stats

    fn dataset_stats(dataset : TrainingDataset) -> (Int, Int, Array[(String, Int)])

    数据集统计信息

    decompose_chinese_char

    fn decompose_chinese_char(char : String) -> ChineseCharStructure raise
    core
    /types.LoadError

    汉字部件分解(简化版)

    dense_backward

    fn dense_backward(grad_output : Array[Double], weights : Array[Double], in_features : Int, out_features : Int) -> (Array[Double], Array[Double], Array[Double])

    全连接层反向传播

    dense_forward

    fn dense_forward(input : Array[Double], weights : Array[Double], biases : Array[Double], in_features : Int, out_features : Int, activation : String) -> Array[Double]

    全连接层前向传播

    deskew

    fn deskew(img :
    core
    /types.Image) ->
    core
    /types.Image raise
    core
    /types.LoadError

    倾斜校正(自动检测倾斜角度并旋转)

    detect_char_language

    fn detect_char_language(char_img :
    core
    /types.Image) -> LanguageType raise
    core
    /types.LoadError

    检测字符语言类型(基于宽高比和尺寸)

    detect_column_boundaries

    fn detect_column_boundaries(text_lines : Array[TextLineAttributes], page_width : Int, layout_type : LayoutType) -> Array[Int]

    检测列边界

    detect_columns

    fn detect_columns(img :
    core
    /types.Image) -> (Int, Array[(Int, Int)]) raise
    core
    /types.LoadError

    检测多栏布局 返回栏数和每栏的 x 范围

    detect_distortions

    fn detect_distortions(img :
    core
    /types.Image) -> Array[DistortionDetectionResult] raise
    core
    /types.LoadError

    检测畸变类型和严重程度

    detect_document_columns

    fn detect_document_columns(img :
    core
    /types.Image) -> Int raise
    core
    /types.LoadError

    检测多栏布局并返回栏数

    detect_document_language

    fn detect_document_language(img :
    core
    /types.Image) -> LanguageType raise
    core
    /types.LoadError

    检测文档主要语言

    detect_handwriting_slant

    fn detect_handwriting_slant(img :
    core
    /types.Image) -> Double raise
    core
    /types.LoadError

    检测手写体倾斜角度
    fn detect_header_footer(text_lines : Array[TextLineAttributes], page_height : Int) -> (Int, Int) raise
    core
    /types.LoadError

    检测页眉页脚区域

    detect_horizontal_lines

    fn detect_horizontal_lines(img :
    core
    /types.Image, min_length? : Int, max_gap? : Int) -> Array[TableLine] raise
    core
    /types.LoadError

    检测水平表格线

    detect_horizontal_table_lines

    fn detect_horizontal_table_lines(binary_img :
    core
    /types.Image, min_length? : Int, max_gap? : Int) -> Array[(Int, Int, Int)] raise
    core
    /types.LoadError

    检测水平表格线(基于形态学操作的简化版)

    detect_image_regions_markdown

    fn detect_image_regions_markdown(binary_img :
    core
    /types.Image, min_area? : Int) -> Array[MarkdownImage] raise
    core
    /types.LoadError

    检测图片区域(基于连通域分析的简化版)

    detect_language_enhanced

    fn detect_language_enhanced(char_img :
    core
    /types.Image) -> LanguageDetectionResult raise
    core
    /types.LoadError

    增强语言检测(基于多特征的分类器)

    detect_layout_type

    fn detect_layout_type(text_lines : Array[TextLineAttributes], page_width : Int, page_height : Int) -> LayoutType raise
    core
    /types.LoadError

    检测页面布局类型(单栏/双栏/多栏)

    detect_list_item

    fn detect_list_item(line : TextLineAttributes) -> ListItemInfo

    检测列表项

    detect_paragraphs

    fn detect_paragraphs(blocks : Array[DocumentBlock], max_line_spacing_ratio? : Double) -> Array[Array[Int]]

    段落检测(基于行间距和缩进)

    detect_skew_angle

    fn detect_skew_angle(img :
    core
    /types.Image) -> Double raise
    core
    /types.LoadError

    检测图像倾斜角度(基于水平投影的方差最大化) 返回角度(度),正值表示顺时针倾斜

    detect_skew_angle_robust

    fn detect_skew_angle_robust(binary_img :
    core
    /types.Image) -> Double raise
    core
    /types.LoadError

    检测倾斜角度(基于霍夫变换的简化版)

    detect_table_enhanced

    fn detect_table_enhanced(binary_img :
    core
    /types.Image, min_table_size? : Int) -> Array[EnhancedTableResult] raise
    core
    /types.LoadError

    完整表格检测

    detect_text_lines_projection

    fn detect_text_lines_projection(img :
    core
    /types.Image, min_height? : Int, max_gap? : Int) -> Array[TextLineInfo] raise
    core
    /types.LoadError

    检测文本行(基于水平投影)

    detect_text_regions

    fn detect_text_regions(img :
    core
    /types.Image) -> Array[TextRegion] raise
    core
    /types.LoadError

    检测文本区域(基于投影分析) 返回文本区域列表

    detect_titles

    fn detect_titles(blocks : Array[DocumentBlock], title_font_size_threshold? : Int) -> Array[Int]

    标题检测(基于字体大小、位置、加粗特征)

    detect_touching_chars

    fn detect_touching_chars(img :
    core
    /types.Image, min_char_width? : Int, max_char_width? : Int) -> Array[Int] raise
    core
    /types.LoadError

    检测粘连字符(基于垂直投影的局部最小值分析) 返回粘连位置列表

    detect_vertical_lines

    fn detect_vertical_lines(img :
    core
    /types.Image, min_length? : Int, max_gap? : Int) -> Array[TableLine] raise
    core
    /types.LoadError

    检测垂直表格线

    detect_vertical_table_lines

    fn detect_vertical_table_lines(binary_img :
    core
    /types.Image, min_length? : Int, max_gap? : Int) -> Array[(Int, Int, Int)] raise
    core
    /types.LoadError

    检测垂直表格线

    determine_reading_order_markdown

    fn determine_reading_order_markdown(elements : Array[MarkdownElement]) -> Array[Int]

    确定阅读顺序

    dictionary_create

    fn dictionary_create(words : Array[String]) -> Dictionary raise
    core
    /types.LoadError

    创建词典

    dictionary_create_common_english

    fn dictionary_create_common_english() -> Dictionary

    创建常用英文单词词典

    dictionary_match

    fn dictionary_match(word : String, dictionary : Dictionary, max_distance? : Int) -> Array[(String, Int)] raise
    core
    /types.LoadError

    词典匹配:查找最相似的单词

    digit_ocr_default_config

    fn digit_ocr_default_config() -> DigitOcrConfig

    创建默认数字 OCR 配置

    document_enhance

    fn document_enhance(img :
    core
    /types.Image) ->
    core
    /types.Image raise
    core
    /types.LoadError

    文档图像增强(去噪+对比度+锐化) 适用于扫描文档和照片文档的预处理

    document_statistics_enhanced

    fn document_statistics_enhanced(blocks : Array[DocumentBlock]) -> (Int, Int, Int, Int, Int, Int, Int)

    文档统计信息(增强版)

    document_structure_stats

    fn document_structure_stats(structure : DocumentStructure) -> (Int, Int, Int, Int, Int)

    文档结构统计

    document_understanding_enhanced_default_config

    fn document_understanding_enhanced_default_config() -> DocumentUnderstandingEnhancedConfig

    创建默认增强文档理解配置

    drop_fall_segmentation

    fn drop_fall_segmentation(img :
    core
    /types.Image, start_x? : Int) -> DropFallResult raise
    core
    /types.LoadError

    滴水算法(Drop Fall Algorithm) 用于分割粘连字符,模拟水滴从顶部落下的路径

    edit_distance

    fn edit_distance(s1 : String, s2 : String) -> Int raise
    core
    /types.LoadError

    计算编辑距离(Levenshtein距离)

    elastic_match

    fn elastic_match(features : Array[Double], template : Array[Double], elasticity? : Double, grid_size? : Int) -> Double

    弹性匹配(允许形状变形的模板匹配)

    english_ocr_default_config

    fn english_ocr_default_config() -> EnglishOcrConfig

    创建默认英文 OCR 配置

    enhanced_chinese_ocr_default_config

    fn enhanced_chinese_ocr_default_config() -> EnhancedChineseOcrConfig

    创建默认增强中文 OCR 配置

    enhanced_document_to_markdown

    fn enhanced_document_to_markdown(doc : EnhancedDocument, include_header_footer? : Bool) -> String

    增强版文档转 Markdown

    enhanced_element_distribution

    fn enhanced_element_distribution(doc : EnhancedDocument) -> Array[(String, Int)]

    统计增强版文档元素分布

    enhanced_table_to_markdown

    fn enhanced_table_to_markdown(table : EnhancedTableResult) -> String

    表格转 Markdown(增强版,支持单元格内容)

    ensemble_default_config

    fn ensemble_default_config() -> EnsembleConfig

    创建默认集成配置

    ensemble_predict

    fn ensemble_predict(features : Array[Double], knn_classifier : KnnClassifier, templates : Array[(String, Array[Double])], config? : EnsembleConfig) -> ClassificationResult raise
    core
    /types.LoadError

    集成分类器预测(多分类器投票)

    estimate_memory_usage

    fn estimate_memory_usage(image_count : Int, image_width : Int, image_height : Int, channels : Int) -> MemoryUsageStats

    估算内存使用(简化版)

    euclidean_distance

    fn euclidean_distance(a : Array[Double], b : Array[Double]) -> Double raise
    core
    /types.LoadError

    计算欧氏距离

    evaluate_cnn_model

    fn evaluate_cnn_model(test_samples : Array[DLTrainingSample], config : DLCnnModelConfig, labels : Array[String]) -> (Double, Double) raise
    core
    /types.LoadError

    评估 CNN 模型准确率和平均置信度

    evaluate_scan_quality

    fn evaluate_scan_quality(img :
    core
    /types.Image) -> ScanQuality raise
    core
    /types.LoadError

    评估扫描图像质量

    extract_all_cells

    fn extract_all_cells(img :
    core
    /types.Image, structure : TableStructure, padding? : Int) -> Array[
    core
    /types.Image] raise
    core
    /types.LoadError

    提取所有单元格图像

    extract_cell_image

    fn extract_cell_image(img :
    core
    /types.Image, cell : TableCell, padding? : Int) ->
    core
    /types.Image raise
    core
    /types.LoadError

    提取单元格图像

    extract_char_image

    fn extract_char_image(img :
    core
    /types.Image, char : CharSegment, target_size? : Int, padding? : Int) ->
    core
    /types.Image raise
    core
    /types.LoadError

    提取字符图像

    extract_combined_enhanced_features

    fn extract_combined_enhanced_features(char_img :
    core
    /types.Image, config : OcrAccuracyEnhancedConfig) -> Array[Double] raise
    core
    /types.LoadError

    组合多种特征(网格+HOG+LBP+Zernike+Gabor+方向特征)

    extract_combined_ocr_features

    fn extract_combined_ocr_features(img :
    core
    /types.Image) -> Array[Double] raise
    core
    /types.LoadError

    组合多种特征(网格+HOG+LBP+Hu矩)

    extract_directional_features

    fn extract_directional_features(char_img :
    core
    /types.Image) -> Array[Double]

    提取方向特征(8个方向的笔画密度)

    extract_document_text

    fn extract_document_text(blocks : Array[DocumentBlock], include_headers? : Bool, include_footers? : Bool) -> String

    提取文档纯文本(按阅读顺序)

    extract_features

    fn extract_features(extractor : DLFeatureExtractor, img :
    core
    /types.Image) -> Array[Double]

    提取图像特征

    extract_gabor_ocr_features

    fn extract_gabor_ocr_features(char_img :
    core
    /types.Image, num_orientations? : Int, num_frequencies? : Int) -> Array[Double]

    提取 Gabor 特征(多方向多频率)

    extract_handwriting_features

    fn extract_handwriting_features(img :
    core
    /types.Image, char : String) -> HandwritingCharFeature raise
    core
    /types.LoadError

    提取手写字符特征

    extract_handwriting_stroke_features

    fn extract_handwriting_stroke_features(char_img :
    core
    /types.Image) -> HandwritingStrokeFeatures raise
    core
    /types.LoadError

    提取手写体笔画特征

    extract_headings

    fn extract_headings(structure : DocumentStructure) -> Array[DocumentElement]

    提取所有标题

    extract_hw_stroke_features

    fn extract_hw_stroke_features(img :
    core
    /types.Image) -> Array[StrokeFeature]

    提取笔画特征

    extract_images_enhanced

    fn extract_images_enhanced(binary_img :
    core
    /types.Image, min_area? : Int) -> Array[ExtractedImage]

    提取图片区域(增强版,支持多种图片类型判断)

    extract_paragraphs

    fn extract_paragraphs(structure : DocumentStructure) -> Array[DocumentElement]

    提取正文段落

    extract_stroke_features

    fn extract_stroke_features(char_img :
    core
    /types.Image) -> Array[Double] raise
    core
    /types.LoadError

    提取笔画特征(端点、交叉点、笔画数估计)

    extract_text_line_image

    fn extract_text_line_image(img :
    core
    /types.Image, line : TextLineInfo, padding? : Int) ->
    core
    /types.Image raise
    core
    /types.LoadError

    提取文本行图像

    extract_text_lines

    fn extract_text_lines(img :
    core
    /types.Image) -> Array[
    core
    /types.Image] raise
    core
    /types.LoadError

    提取文本行图像 返回文本行图像列表

    extract_title

    fn extract_title(structure : DocumentStructure) -> String

    提取标题

    extract_zernike_moments

    fn extract_zernike_moments(char_img :
    core
    /types.Image, max_order? : Int) -> Array[Double] raise
    core
    /types.LoadError

    提取 Zernike 矩特征(旋转不变性,前6阶)

    fast_connected_components

    fn fast_connected_components(binary_img :
    core
    /types.Image) -> Array[Int] raise
    core
    /types.LoadError

    快速连通域标记(两遍扫描法优化版)

    fast_downsample_2x

    fn fast_downsample_2x(img :
    core
    /types.Image) ->
    core
    /types.Image raise
    core
    /types.LoadError

    内存优化的图像降采样(2x2 均值采样)

    fast_gaussian_blur_1d

    fn fast_gaussian_blur_1d(img :
    core
    /types.Image, kernel : Array[Double]) ->
    core
    /types.Image raise
    core
    /types.LoadError

    使用预计算核快速高斯模糊(1D 分离卷积)

    fast_threshold_lut

    fn fast_threshold_lut(img :
    core
    /types.Image, lut : Array[Int]) ->
    core
    /types.Image raise
    core
    /types.LoadError

    使用查找表快速二值化

    filter_components_by_area

    fn filter_components_by_area(result : OcrConnectedComponentsResult, min_area : Int, max_area : Int) -> Array[OcrConnectedComponent] raise
    core
    /types.LoadError

    按面积筛选连通域

    filter_components_by_aspect_ratio

    fn filter_components_by_aspect_ratio(result : OcrConnectedComponentsResult, min_ratio : Double, max_ratio : Double) -> Array[OcrConnectedComponent] raise
    core
    /types.LoadError

    按宽高比筛选连通域

    filter_components_by_position

    fn filter_components_by_position(result : OcrConnectedComponentsResult, x : Int, y : Int, width : Int, height : Int) -> Array[OcrConnectedComponent] raise
    core
    /types.LoadError

    按位置筛选连通域(在指定矩形内)

    filter_noise_segments

    fn filter_noise_segments(segments : Array[(Int, Int, Int, Int)], img_width : Int, img_height : Int, min_area_ratio? : Double, max_area_ratio? : Double) -> Array[(Int, Int, Int, Int)] raise
    core
    /types.LoadError

    分割后处理:过滤噪声区域

    find_line_intersections

    fn find_line_intersections(h_lines : Array[(Int, Int, Int)], v_lines : Array[(Int, Int, Int)]) -> Array[(Int, Int)]

    检测表格线交叉点

    find_similar_chinese_chars

    fn find_similar_chinese_chars(dict : DictChineseDict, target_char : String, top_n? : Int) -> Array[DictCharMatch] raise
    core
    /types.LoadError

    查找最相似的汉字(用于 OCR 纠错)

    full_postprocess_correction

    fn full_postprocess_correction(text : String, context_type? : String) -> CorrectionResult raise
    core
    /types.LoadError

    完整的后处理纠错流水线

    generate_3500_chinese_templates

    fn generate_3500_chinese_templates(char_set? : String) -> Array[(String, Array[Double])]

    生成 3500 常用汉字模板

    generate_accuracy_report

    fn generate_accuracy_report(stats : AccuracyStats, dataset_name : String) -> String

    生成准确率报告

    generate_api_config_json

    fn generate_api_config_json(config : ApiServerConfig) -> String

    生成 API Server 启动配置 JSON

    generate_batch_summary

    fn generate_batch_summary(tasks : Array[BatchTask], total_time_ms : Double) -> BatchResultSummary raise
    core
    /types.LoadError

    生成批处理结果汇总

    generate_chinese_char_info_db

    fn generate_chinese_char_info_db() -> Array[ChineseCharInfo]

    生成汉字结构信息数据库(1000常用字)

    generate_chinese_dictionary_report

    fn generate_chinese_dictionary_report(dict : DictChineseDict) -> String

    生成中文字库统计报告

    generate_chinese_templates

    fn generate_chinese_templates(char_set? : String) -> Array[(String, Array[Double])]

    生成常用汉字模板(100个常用汉字)

    generate_cli_help

    fn generate_cli_help() -> String

    生成 CLI 帮助文本

    generate_correction_report

    fn generate_correction_report(results : Array[CorrectionResult]) -> String

    生成纠错报告

    generate_deployment_package

    fn generate_deployment_package(docker_config : DockerConfig, api_config : ApiServerConfig, model_config : ModelPackageConfig) -> String

    生成完整部署包

    generate_digit_templates

    fn generate_digit_templates() -> Array[(String, Array[Double])]

    生成数字模板特征(0-9) 使用简单的合成模板

    generate_docker_compose

    fn generate_docker_compose(config : DockerConfig) -> String

    生成 docker-compose.yml 内容

    generate_dockerfile

    fn generate_dockerfile(config : DockerConfig) -> String

    生成 Dockerfile 内容

    generate_english_templates

    fn generate_english_templates(case_sensitive? : Bool) -> Array[(String, Array[Double])]

    生成英文字符模板(0-9, A-Z) 不区分大小写时只生成大写

    generate_enhanced_chinese_templates

    fn generate_enhanced_chinese_templates(char_set_size? : Int) -> Array[(String, Array[Double])]

    生成优化的汉字模板(1000常用字,改进的哈希算法)

    generate_enhanced_handwriting_templates

    fn generate_enhanced_handwriting_templates(char_set? : String, num_variants? : Int) -> Array[(String, Array[Double])]

    生成增强手写体模板(每字符5种变体)

    generate_env_config

    fn generate_env_config(env : DeploymentEnvironment) -> String

    生成环境配置

    generate_handwriting_templates

    fn generate_handwriting_templates(char_set? : String) -> Array[(String, Array[Double])]

    生成手写体数字模板(更灵活的形状)

    generate_health_check_config

    fn generate_health_check_config(config : ApiServerConfig) -> String

    生成健康检查端点配置

    generate_image_extraction_report

    fn generate_image_extraction_report(images : Array[ExtractedImage]) -> String

    生成图片提取报告

    generate_markdown_image_placeholder

    fn generate_markdown_image_placeholder(image : MarkdownImage, index : Int) -> String

    生成 Markdown 图片占位符

    generate_model_manifest

    fn generate_model_manifest(config : ModelPackageConfig) -> String

    生成模型打包清单

    generate_performance_report

    fn generate_performance_report(benchmark : PerformanceBenchmark, dataset_name : String) -> String

    生成性能基准报告

    generate_punctuation_templates

    fn generate_punctuation_templates() -> Array[PunctuationTemplate]

    生成标点符号模板

    generate_robustness_report

    fn generate_robustness_report(quality : ScanQuality, distortions : Array[DistortionDetectionResult], layout : ComplexLayoutAnalysis) -> RobustnessReport

    生成鲁棒性评估报告

    generate_training_progress_report

    fn generate_training_progress_report(state : TrainingState, config : TrainingConfig) -> String

    生成训练进度报告

    generate_training_report

    fn generate_training_report(history : Array[DLTrainingHistory], config : DLCnnModelConfig) -> String

    生成训练报告

    get_elements_in_reading_order

    fn get_elements_in_reading_order(structure : DocumentStructure) -> Array[DocumentElement]

    按阅读顺序获取元素

    grid_features

    fn grid_features(img :
    core
    /types.Image, grid_rows? : Int, grid_cols? : Int) -> GridFeatures raise
    core
    /types.LoadError

    计算网格特征(将图像分成网格,每个格子计算像素密度)

    handwriting_feature_similarity

    fn handwriting_feature_similarity(feat1 : HandwritingCharFeature, feat2 : HandwritingCharFeature) -> Double

    计算手写特征相似度

    handwriting_ocr_default_config

    fn handwriting_ocr_default_config() -> HandwritingOcrConfig

    创建默认手写体识别配置

    handwriting_ocr_enhanced_default_config

    fn handwriting_ocr_enhanced_default_config() -> HandwritingOcrEnhancedConfig

    创建默认增强手写体识别配置

    handwriting_postprocess

    fn handwriting_postprocess(text : String, confidence : Double) -> (String, Double)

    手写体后处理(基于常见手写体混淆的纠错)

    handwriting_report_to_string

    fn handwriting_report_to_string(result : HandwritingRecognitionResult) -> String

    生成手写识别报告

    hog_features

    fn hog_features(img :
    core
    /types.Image, cell_size? : Int, num_bins? : Int) -> HogFeatures raise
    core
    /types.LoadError

    计算 HOG 特征(方向梯度直方图)

    horizontal_projection

    fn horizontal_projection(img :
    core
    /types.Image) -> ProjectionResult raise
    core
    /types.LoadError

    水平投影(按行统计前景像素数)

    hu_moments_features

    fn hu_moments_features(img :
    core
    /types.Image) -> Array[Double] raise
    core
    /types.LoadError

    Hu 矩特征(7个不变矩)

    is_code_block_line

    fn is_code_block_line(line : TextLineAttributes, avg_indent : Int) -> Bool

    判断是否为代码块(基于缩进和等宽字体特征)

    is_heading_line

    fn is_heading_line(line : TextLineAttributes, avg_font_size : Double) -> (Bool, Int)

    判断文本行是否为标题

    is_quote_line

    fn is_quote_line(line : TextLineAttributes, avg_x : Int) -> Bool

    判断是否为引用块(基于左边距和竖线)

    knn_add_sample

    fn knn_add_sample(classifier : KnnClassifier, features : Array[Double], label : String) -> KnnClassifier raise
    core
    /types.LoadError

    添加训练样本

    knn_add_samples

    fn knn_add_samples(classifier : KnnClassifier, samples : Array[(Array[Double], String)]) -> KnnClassifier raise
    core
    /types.LoadError

    批量添加训练样本

    knn_create

    fn knn_create(k? : Int, distance_metric? : String) -> KnnClassifier raise
    core
    /types.LoadError

    创建 KNN 分类器

    knn_predict

    fn knn_predict(classifier : KnnClassifier, features : Array[Double]) -> ClassificationResult raise
    core
    /types.LoadError

    KNN 预测

    language_model_postprocess

    fn language_model_postprocess(text : String, char_languages : Array[String], confidences : Array[Double]) -> (String, Array[Double])

    语言模型后处理(基于N-gram的混排纠错)

    lbp_features

    fn lbp_features(img :
    core
    /types.Image, radius? : Int, num_points? : Int, num_bins? : Int) -> LbpFeatures raise
    core
    /types.LoadError

    计算 LBP 特征(局部二值模式)

    load_model

    fn load_model(path : String) -> DLCnnModelConfig?

    模型加载

    lookup_by_pinyin

    fn lookup_by_pinyin(dict : DictChineseDict, pinyin : String) -> Array[DictCharEntry] raise
    core
    /types.LoadError

    根据拼音查找汉字

    lookup_by_radical

    fn lookup_by_radical(dict : DictChineseDict, radical : String) -> Array[DictCharEntry] raise
    core
    /types.LoadError

    根据部首查找汉字

    lookup_by_structure

    fn lookup_by_structure(dict : DictChineseDict, structure : DictCharStructure) -> Array[DictCharEntry]

    根据结构类型查找汉字

    lookup_char

    fn lookup_char(dict : DictChineseDict, char : String) -> DictCharEntry? raise
    core
    /types.LoadError

    查找汉字条目

    manhattan_distance

    fn manhattan_distance(a : Array[Double], b : Array[Double]) -> Double raise
    core
    /types.LoadError

    计算曼哈顿距离

    mark_task_completed

    fn mark_task_completed(task : BatchTask, char_count : Int, accuracy : Double, end_time : Double) -> BatchTask

    标记任务完成

    mark_task_failed

    fn mark_task_failed(task : BatchTask, error_message : String, end_time : Double) -> BatchTask

    标记任务失败

    markdown_document_to_string

    fn markdown_document_to_string(doc : MarkdownDocument) -> String

    完整文档转 Markdown(1:1 还原)

    markdown_table_to_string

    fn markdown_table_to_string(table : MarkdownTable) -> String

    表格数据转 Markdown

    max_pool2d

    fn max_pool2d(input : Array[Double], in_h : Int, in_w : Int, channels : Int, pool_size : Int) -> Array[Double] raise
    core
    /types.LoadError

    2D 最大池化

    max_pool2d_backward

    fn max_pool2d_backward(grad_output : Array[Double], input : Array[Double], in_h : Int, in_w : Int, in_c : Int, pool_size : Int) -> Array[Double]

    MaxPool2D 反向传播:梯度透传到最大值位置

    merge_adjacent_components

    fn merge_adjacent_components(components : Array[OcrConnectedComponent], max_gap : Int) -> Array[OcrConnectedComponent] raise
    core
    /types.LoadError

    合并相邻连通域(用于字符合并)

    merge_small_segments

    fn merge_small_segments(segments : Array[(Int, Int, Int, Int)], min_width : Int, min_height : Int) -> Array[(Int, Int, Int, Int)] raise
    core
    /types.LoadError

    分割后处理:合并过小的分割区域

    multi_scale_recognize

    fn multi_scale_recognize(char_img :
    core
    /types.Image, templates : Array[(String, Array[Double])], scales : Array[Int], distance_metric? : String) -> (String, Double)

    多尺度识别融合(不同尺寸下的识别结果加权融合)

    multilingual_ocr_default_config

    fn multilingual_ocr_default_config() -> MultilingualOcrConfig

    创建默认多语言识别配置

    multilingual_ocr_enhanced_default_config

    fn multilingual_ocr_enhanced_default_config() -> MultilingualOcrEnhancedConfig

    创建默认增强多语言识别配置

    next_batch

    fn next_batch(loader : DataLoader) -> (Array[DLTrainingSample], DataLoader) raise
    core
    /types.LoadError

    获取下一批数据

    ngram_create

    fn ngram_create(texts : Array[String], n? : Int) -> NgramModel raise
    core
    /types.LoadError

    创建 N-gram 模型(从文本训练)

    ngram_score

    fn ngram_score(text : String, model : NgramModel) -> Double raise
    core
    /types.LoadError

    计算文本的 N-gram 概率(简化版)

    niblack_threshold

    fn niblack_threshold(img :
    core
    /types.Image, window_size? : Int, k? : Double) ->
    core
    /types.Image raise
    core
    /types.LoadError

    Niblack 局部阈值二值化 自适应阈值 T(x,y) = mean(x,y) + k * std(x,y) k: 修正系数,通常 -0.2 window_size: 局部窗口大小(奇数)

    normalize_features

    fn normalize_features(features : Array[Double]) -> Array[Double] raise
    core
    /types.LoadError

    特征归一化(Min-Max 归一化到 [0, 1])

    normalize_handwriting_size

    fn normalize_handwriting_size(img :
    core
    /types.Image, target_size : Int) ->
    core
    /types.Image raise
    core
    /types.LoadError

    手写字符大小归一化(简化版,返回尺寸信息)

    normalize_image

    fn normalize_image(image_data : Array[Double], mean : Double, std : Double) -> Array[Double] raise
    core
    /types.LoadError

    图像归一化

    normalize_punctuation

    fn normalize_punctuation(text : String, char_languages : Array[String]) -> String

    标点符号规范化(中英文标点自动转换)

    ocr_accuracy_enhanced_default_config

    fn ocr_accuracy_enhanced_default_config() -> OcrAccuracyEnhancedConfig

    创建默认准确率提升配置

    ocr_pipeline_stats

    fn ocr_pipeline_stats(img :
    core
    /types.Image) -> (Int, Int, Double) raise
    core
    /types.LoadError

    OCR 流水线性能统计

    ocr_postprocess

    fn ocr_postprocess(result : OcrResult, config? : PostProcessConfig, dictionary? : Dictionary, ngram_model? : NgramModel) -> OcrResult raise
    core
    /types.LoadError

    完整后处理流水线

    ocr_preprocess

    fn ocr_preprocess(img :
    core
    /types.Image, binarization_method? : String) ->
    core
    /types.Image raise
    core
    /types.LoadError

    OCR 完整预处理流水线 灰度化 -> 去噪 -> 倾斜校正 -> 二值化 -> 输出

    ocr_result_to_hocr

    fn ocr_result_to_hocr(result : OCRPageResult) -> String

    OCR 结果导出为 hOCR 格式(简化版)

    ocr_result_to_json

    fn ocr_result_to_json(result : OCRPageResult) -> String

    OCR 结果导出为 JSON

    ocr_result_to_text

    fn ocr_result_to_text(result : OCRPageResult) -> String

    OCR 结果导出为纯文本

    optimize_reading_order

    fn optimize_reading_order(blocks : Array[DocumentBlock], num_columns : Int) -> Array[Int]

    优化阅读顺序(基于列和几何关系)

    otsu_threshold

    fn otsu_threshold(img :
    core
    /types.Image) ->
    core
    /types.Image raise
    core
    /types.LoadError

    Otsu 全局阈值二值化(自动计算最佳阈值)

    parse_cli_args

    fn parse_cli_args(args : Array[String]) -> CliConfig raise
    core
    /types.LoadError

    解析 CLI 参数(简化版)

    postprocess_default_config

    fn postprocess_default_config() -> PostProcessConfig

    创建默认后处理配置

    progress_bar_to_string

    fn progress_bar_to_string(progress : Double, width? : Int) -> String

    生成进度条字符串

    projection_features

    fn projection_features(img :
    core
    /types.Image) -> ProjectionFeatures raise
    core
    /types.LoadError

    计算投影特征

    recognize_by_components

    fn recognize_by_components(dict : DictChineseDict, detected_structure : DictCharStructure, detected_components : Array[String], stroke_count_hint? : Int) -> Array[(String, Double)]

    基于部件的汉字识别(简化版)

    recognize_chinese

    fn recognize_chinese(img :
    core
    /types.Image, config? : ChineseOcrConfig) -> OcrResult raise
    core
    /types.LoadError

    中文 OCR 识别(完整流水线)

    recognize_chinese_advanced

    fn recognize_chinese_advanced(img :
    core
    /types.Image, config? : AdvancedChineseOcrConfig) -> OcrResult raise
    core
    /types.LoadError

    完善中文 OCR 识别(完整流水线)

    recognize_digits

    fn recognize_digits(img :
    core
    /types.Image, config? : DigitOcrConfig) -> OcrResult raise
    core
    /types.LoadError

    数字 OCR 识别(完整流水线) 预处理 → 字符分割 → 特征提取 → 模板匹配分类

    recognize_english

    fn recognize_english(img :
    core
    /types.Image, config? : EnglishOcrConfig) -> OcrResult raise
    core
    /types.LoadError

    英文 OCR 识别(完整流水线)

    recognize_enhanced_chinese

    fn recognize_enhanced_chinese(img :
    core
    /types.Image, config? : EnhancedChineseOcrConfig) -> OcrResult raise
    core
    /types.LoadError

    增强中文 OCR 识别(完整流水线:结构预筛选 + 模板匹配 + 笔画特征)

    recognize_handwriting

    #deprecated("Use recognize_handwriting_enhanced instead")
    fn recognize_handwriting(img :
    core
    /types.Image, config? : HandwritingOcrConfig) -> OcrResult raise
    core
    /types.LoadError

    手写体识别(完整流水线) @deprecated 已废弃,请使用 recognize_handwriting_enhanced 代替

    recognize_handwriting_char

    fn recognize_handwriting_char(img :
    core
    /types.Image, templates : Array[HandwritingTemplate], config : HandwritingRecognitionConfig) -> HandwritingRecognitionResult raise
    core
    /types.LoadError

    手写字符识别

    recognize_handwriting_enhanced

    fn recognize_handwriting_enhanced(img :
    core
    /types.Image, config? : HandwritingOcrEnhancedConfig) -> OcrResult raise
    core
    /types.LoadError

    增强手写体识别(完整流水线)

    recognize_multilingual

    #deprecated("Use recognize_multilingual_enhanced instead")
    fn recognize_multilingual(img :
    core
    /types.Image, config? : MultilingualOcrConfig) -> OcrResult raise
    core
    /types.LoadError

    多语言混合识别(完整流水线) @deprecated 已废弃,请使用 recognize_multilingual_enhanced 代替

    recognize_multilingual_enhanced

    fn recognize_multilingual_enhanced(img :
    core
    /types.Image, config? : MultilingualOcrEnhancedConfig) -> OcrResult raise
    core
    /types.LoadError

    增强多语言混合识别(完整流水线)

    recognize_ocr_enhanced

    fn recognize_ocr_enhanced(img :
    core
    /types.Image, templates : Array[(String, Array[Double])], config? : OcrAccuracyEnhancedConfig) -> OcrResult raise
    core
    /types.LoadError

    增强 OCR 识别(完整准确率提升流水线)

    recognize_symbols_markdown

    fn recognize_symbols_markdown(text : String) -> Array[MarkdownSymbol]

    识别文本中的符号

    recognize_table

    fn recognize_table(img :
    core
    /types.Image, min_line_length? : Int) -> TableStructure raise
    core
    /types.LoadError

    完整表格识别流水线

    record_training_metrics

    fn record_training_metrics(state : TrainingState, metrics : TrainingMetrics) -> TrainingState

    记录训练指标

    relu

    fn relu(x : Double) -> Double

    ReLU 激活函数

    relu_backward

    fn relu_backward(grad : Array[Double], fwd : Array[Double]) -> Array[Double]

    ReLU 反向传播

    resize_image_for_cnn

    fn resize_image_for_cnn(img :
    core
    /types.Image, target_width : Int, target_height : Int) -> Array[Double] raise
    core
    /types.LoadError

    图像缩放(双线性插值简化版)

    robustness_report_to_string

    fn robustness_report_to_string(report : RobustnessReport) -> String

    生成鲁棒性报告文本

    rotate_document

    fn rotate_document(img :
    core
    /types.Image, angle : Double) ->
    core
    /types.Image raise
    core
    /types.LoadError

    文档旋转(带白色背景填充) angle: 旋转角度(度),正值表示逆时针

    sauvola_threshold

    fn sauvola_threshold(img :
    core
    /types.Image, window_size? : Int, k? : Double, r? : Double) ->
    core
    /types.Image raise
    core
    /types.LoadError

    Sauvola 局部阈值二值化(Niblack 的改进版,适合文档图像) 自适应阈值 T(x,y) = mean(x,y) * (1 + k * (std(x,y)/R - 1)) k: 修正系数,通常 0.5 R: 标准差的动态范围,通常 128 window_size: 局部窗口大小(奇数)

    save_model

    fn save_model(config : DLCnnModelConfig, weights : Array[Double], path : String) -> Bool

    模型保存(简化版,保存为 JSON)

    scan_document_preprocess

    fn scan_document_preprocess(img :
    core
    /types.Image, config : ScanOCRConfig) ->
    core
    /types.Image raise
    core
    /types.LoadError

    扫描文档预处理流水线

    scan_ocr_default_config

    fn scan_ocr_default_config() -> ScanOCRConfig

    创建默认扫描 OCR 配置

    scan_ocr_recognize

    fn scan_ocr_recognize(img :
    core
    /types.Image, config : ScanOCRConfig) -> OCRPageResult raise
    core
    /types.LoadError

    扫描文档 OCR 完整流水线

    segment_by_connected_components

    fn segment_by_connected_components(img :
    core
    /types.Image, min_area? : Int, max_area? : Int) -> Array[(Int, Int, Int, Int)] raise
    core
    /types.LoadError

    基于连通域的字符分割 返回字符区域列表

    segment_chars_projection

    fn segment_chars_projection(img :
    core
    /types.Image, line : TextLineInfo, min_width? : Int, max_gap? : Int) -> Array[CharSegment] raise
    core
    /types.LoadError

    文本行字符分割(基于垂直投影)

    segment_connected_strokes

    fn segment_connected_strokes(img :
    core
    /types.Image, config : HandwritingRecognitionConfig) -> StrokeSegmentationResult

    连笔分割

    segment_cursive_chars

    fn segment_cursive_chars(img :
    core
    /types.Image, min_char_width? : Int, max_char_width? : Int) -> Array[(Int, Int, Int, Int)]

    连笔字符分割(基于笔画特征的分割点检测)

    segment_page

    fn segment_page(img :
    core
    /types.Image) -> Array[TextRegion] raise
    core
    /types.LoadError

    页面分割(文本/图像/表格区域) 返回区域列表

    segment_paragraphs

    fn segment_paragraphs(lines : Array[TextLineAttributes]) -> Array[Array[TextLineAttributes]]

    分割段落(基于行间距和首行缩进)

    select_adaptive_config

    fn select_adaptive_config(quality : ScanQuality) -> AdaptivePreprocessConfig raise
    core
    /types.LoadError

    根据扫描质量自动选择预处理配置

    shadow_removal

    fn shadow_removal(img :
    core
    /types.Image, kernel_size? : Int) ->
    core
    /types.Image raise
    core
    /types.LoadError

    阴影去除(基于大核高斯模糊的背景估计) 通过估计背景光照并去除,实现阴影去除

    sigmoid

    fn sigmoid(x : Double) -> Double

    Sigmoid 激活函数

    sigmoid_backward

    fn sigmoid_backward(grad : Array[Double], fwd : Array[Double]) -> Array[Double]

    Sigmoid 反向传播:sigmoid'(x) = sigmoid(x) * (1 - sigmoid(x)) = fwd * (1 - fwd)

    smart_reading_order

    fn smart_reading_order(elements : Array[EnhancedDocumentElement], layout_type : LayoutType, column_boundaries : Array[Int]) -> Array[Int] raise
    core
    /types.LoadError

    智能阅读顺序(支持多栏布局)

    smart_segment_chars

    fn smart_segment_chars(img :
    core
    /types.Image, config : MultilingualOcrEnhancedConfig) -> Array[(Int, Int, Int, Int, String)] raise
    core
    /types.LoadError

    智能字符分割(根据语言类型选择分割策略)

    smart_spacing_process

    fn smart_spacing_process(text : String, char_languages : Array[String]) -> String

    softmax

    fn softmax(logits : Array[Double]) -> Array[Double]

    Softmax 函数

    softmax_cross_entropy_backward

    fn softmax_cross_entropy_backward(predicted : Array[Double], target : Int) -> Array[Double] raise
    core
    /types.LoadError

    Softmax + 交叉熵联合反向传播:grad = predicted - one_hot(target)

    split_train_validation

    fn split_train_validation(samples : Array[DLTrainingSample], validation_split : Double, shuffle : Bool) -> (Array[DLTrainingSample], Array[DLTrainingSample])

    划分训练集和验证集

    standardize_features

    fn standardize_features(features : Array[Double]) -> Array[Double] raise
    core
    /types.LoadError

    特征标准化(Z-score 标准化,均值0,标准差1)

    statistical_features

    fn statistical_features(img :
    core
    /types.Image) -> StatisticalFeatures raise
    core
    /types.LoadError

    计算统计特征

    structure_based_filter

    fn structure_based_filter(char_img :
    core
    /types.Image, char_db : Array[ChineseCharInfo], max_candidates? : Int) -> Array[ChineseCharInfo]

    基于结构信息预筛选候选字(减少匹配范围)

    template_matcher_add

    fn template_matcher_add(matcher : TemplateMatcher, label : String, template : Array[Double]) -> TemplateMatcher raise
    core
    /types.LoadError

    添加模板

    template_matcher_create

    fn template_matcher_create(distance_metric? : String) -> TemplateMatcher

    创建模板匹配分类器

    template_matcher_predict

    fn template_matcher_predict(matcher : TemplateMatcher, features : Array[Double]) -> ClassificationResult raise
    core
    /types.LoadError

    模板匹配预测

    understand_document

    #deprecated("Use understand_document_enhanced instead")
    fn understand_document(img :
    core
    /types.Image) -> DocumentStructure raise
    core
    /types.LoadError

    完整文档理解流水线 @deprecated 已废弃,请使用 understand_document_enhanced 代替

    understand_document_enhanced

    fn understand_document_enhanced(img :
    core
    /types.Image, config? : DocumentUnderstandingEnhancedConfig) -> (Array[DocumentBlock], Array[DocumentTreeNode], String) raise
    core
    /types.LoadError

    完整增强文档理解流水线

    unrolled_pixel_sum

    fn unrolled_pixel_sum(img :
    core
    /types.Image) -> Int raise
    core
    /types.LoadError

    循环展开的像素求和(每次处理4个像素)

    update_task_progress

    fn update_task_progress(task : BatchTask, progress : Double, current_page : Int, total_pages : Int) -> BatchTask

    更新任务进度

    update_weights_sgd

    fn update_weights_sgd(weights : Array[Double], gradients : Array[Double], learning_rate : Double) -> Array[Double] raise
    core
    /types.LoadError

    SGD 权重更新

    vertical_projection

    fn vertical_projection(img :
    core
    /types.Image) -> ProjectionResult raise
    core
    /types.LoadError

    垂直投影(按列统计前景像素数)

    weighted_knn_classify

    fn weighted_knn_classify(features : Array[Double], training_data : Array[(String, Array[Double])], k? : Int, distance_metric? : String) -> (String, Double, Array[(String, Double)])

    加权 KNN 分类(距离加权投票)