Documentation
¶
Overview ¶
Package ocr provides the PaddleOCR API client.
Index ¶
Constants ¶
View Source
const ( LayoutParsingEndpoint = "/layout-parsing" HealthEndpoint = "/health" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the PaddleOCR API client.
func (*Client) IsConfigured ¶
IsConfigured checks if the client is properly configured.
func (*Client) OCRFile ¶
func (c *Client) OCRFile(filePath string, opts OCROptions) *DocumentOCRResult
OCRFile performs OCR on a file.
func (*Client) TestConnection ¶
TestConnection tests the connection to the OCR server.
type DocumentOCRResult ¶
type DocumentOCRResult struct {
Success bool `json:"success"`
Pages []OCRResult `json:"pages"`
ErrorMessage string `json:"error_message,omitempty"`
LogID string `json:"log_id,omitempty"`
}
DocumentOCRResult represents the OCR result for an entire document.
func (*DocumentOCRResult) FullMarkdown ¶
func (r *DocumentOCRResult) FullMarkdown() string
FullMarkdown returns combined markdown from all pages.
type OCROptions ¶
type OCROptions struct {
UseDocOrientationClassify bool
UseDocUnwarping bool
UseChartRecognition bool
Timeout time.Duration
}
OCROptions holds options for OCR processing.
func DefaultOCROptions ¶
func DefaultOCROptions() OCROptions
DefaultOCROptions returns default OCR options.
Click to show internal directories.
Click to hide internal directories.