types

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfidenceDetails

type ConfidenceDetails struct {
	DetectorContribution float64 `json:"detector_contribution,omitempty"`
	TextQuality          float64 `json:"text_quality,omitempty"`
	TextVolume           float64 `json:"text_volume,omitempty"`
	FieldCoverage        float64 `json:"field_coverage,omitempty"`
	MedicalContext       float64 `json:"medical_context,omitempty"`
	Penalties            float64 `json:"penalties,omitempty"`
	WordCoherence        float64 `json:"word_coherence,omitempty"`
	SpacingQuality       float64 `json:"spacing_quality,omitempty"`
	CharacterPattern     float64 `json:"character_pattern,omitempty"`
	SentenceStructure    float64 `json:"sentence_structure,omitempty"`
	GarbledRatio         float64 `json:"garbled_ratio,omitempty"`
}

type CorruptionMetadata

type CorruptionMetadata struct {
	Severity      string   `json:"severity,omitempty"`
	Indicators    []string `json:"indicators,omitempty"`
	FailedPages   int      `json:"failed_pages,omitempty"`
	EmptyPages    int      `json:"empty_pages,omitempty"`
	PagesWithText int      `json:"pages_with_text,omitempty"`
}

type Explanation

type Explanation struct {
	Fields   []FieldExplanation   `json:"fields,omitempty"`
	Fallback *FallbackExplanation `json:"fallback,omitempty"`
}

type ExtractionMetadata

type ExtractionMetadata struct {
	PageCount  int                 `json:"page_count,omitempty"`
	Fallback   *FallbackMetadata   `json:"fallback,omitempty"`
	OCR        *OCRMetadata        `json:"ocr,omitempty"`
	Corruption *CorruptionMetadata `json:"corruption,omitempty"`
}

type FallbackExplanation

type FallbackExplanation struct {
	Attempted    bool    `json:"attempted,omitempty"`
	Used         bool    `json:"used,omitempty"`
	From         Method  `json:"from,omitempty"`
	Reason       string  `json:"reason,omitempty"`
	Summary      string  `json:"summary,omitempty"`
	Confidence   float64 `json:"confidence,omitempty"`
	RawTextChars int     `json:"raw_text_chars,omitempty"`
}

type FallbackMetadata

type FallbackMetadata struct {
	Attempted bool   `json:"attempted,omitempty"`
	Used      bool   `json:"used,omitempty"`
	From      Method `json:"from,omitempty"`
	Reason    string `json:"reason,omitempty"`
}

type FieldExplanation

type FieldExplanation struct {
	Section         string `json:"section"`
	Field           string `json:"field"`
	MatchedBy       string `json:"matched_by"`
	Label           string `json:"label,omitempty"`
	RawValue        string `json:"raw_value,omitempty"`
	NormalizedValue any    `json:"normalized_value,omitempty"`
}

type Method

type Method string
const (
	MethodText  Method = "text"
	MethodMuPDF Method = "mupdf"
	MethodOCR   Method = "ocr"
)

type OCRMetadata

type OCRMetadata struct {
	SelectedPSM          string `json:"selected_psm,omitempty"`
	PreprocessingApplied bool   `json:"preprocessing_applied,omitempty"`
}

type Result

type Result struct {
	DocumentType string                    `json:"document_type"`
	Schema       string                    `json:"schema"`
	Method       Method                    `json:"method"`
	Confidence   float64                   `json:"confidence"`
	Details      *ConfidenceDetails        `json:"confidence_details,omitempty"`
	Metadata     *ExtractionMetadata       `json:"metadata,omitempty"`
	Explanation  *Explanation              `json:"explanation,omitempty"`
	RawText      string                    `json:"raw_text,omitempty"`
	Data         map[string]map[string]any `json:"data"`
	Warnings     []string                  `json:"warnings,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL