formrecognizer

package
v30.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package formrecognizer implements the Azure ARM Formrecognizer service API version 1.0-preview.

Extracts information from forms and images into structured data based on a model created by a set of representative training forms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

Types

type AnalyzeResult

type AnalyzeResult struct {
	autorest.Response `json:"-"`
	// Status - Status of the analyze operation. Possible values include: 'Status2Success', 'Status2PartialSuccess', 'Status2Failure'
	Status Status2 `json:"status,omitempty"`
	// Pages - Page level information extracted in the analyzed
	// document.
	Pages *[]ExtractedPage `json:"pages,omitempty"`
	// Errors - List of errors reported during the analyze
	// operation.
	Errors *[]FormOperationError `json:"errors,omitempty"`
}

AnalyzeResult analyze API call result.

type BaseClient

type BaseClient struct {
	autorest.Client
	Endpoint string
}

BaseClient is the base client for Formrecognizer.

func New

func New(endpoint string) BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults

func NewWithoutDefaults(endpoint string) BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

func (BaseClient) AnalyzeWithCustomModel

func (client BaseClient) AnalyzeWithCustomModel(ctx context.Context, ID uuid.UUID, formStream io.ReadCloser, keys []string) (result AnalyzeResult, err error)

AnalyzeWithCustomModel extract key-value pairs from a given document. The input document must be of one of the supported content types - 'application/pdf', 'image/jpeg' or 'image/png'. A success response is returned in JSON. Parameters: ID - model Identifier to analyze the document with. formStream - a pdf document or image (jpg,png) file to analyze. keys - an optional list of known keys to extract the values for.

func (BaseClient) AnalyzeWithCustomModelPreparer

func (client BaseClient) AnalyzeWithCustomModelPreparer(ctx context.Context, ID uuid.UUID, formStream io.ReadCloser, keys []string) (*http.Request, error)

AnalyzeWithCustomModelPreparer prepares the AnalyzeWithCustomModel request.

func (BaseClient) AnalyzeWithCustomModelResponder

func (client BaseClient) AnalyzeWithCustomModelResponder(resp *http.Response) (result AnalyzeResult, err error)

AnalyzeWithCustomModelResponder handles the response to the AnalyzeWithCustomModel request. The method always closes the http.Response Body.

func (BaseClient) AnalyzeWithCustomModelSender

func (client BaseClient) AnalyzeWithCustomModelSender(req *http.Request) (*http.Response, error)

AnalyzeWithCustomModelSender sends the AnalyzeWithCustomModel request. The method will close the http.Response Body if it receives an error.

func (BaseClient) DeleteCustomModel

func (client BaseClient) DeleteCustomModel(ctx context.Context, ID uuid.UUID) (result autorest.Response, err error)

DeleteCustomModel delete model artifacts. Parameters: ID - the identifier of the model to delete.

func (BaseClient) DeleteCustomModelPreparer

func (client BaseClient) DeleteCustomModelPreparer(ctx context.Context, ID uuid.UUID) (*http.Request, error)

DeleteCustomModelPreparer prepares the DeleteCustomModel request.

func (BaseClient) DeleteCustomModelResponder

func (client BaseClient) DeleteCustomModelResponder(resp *http.Response) (result autorest.Response, err error)

DeleteCustomModelResponder handles the response to the DeleteCustomModel request. The method always closes the http.Response Body.

func (BaseClient) DeleteCustomModelSender

func (client BaseClient) DeleteCustomModelSender(req *http.Request) (*http.Response, error)

DeleteCustomModelSender sends the DeleteCustomModel request. The method will close the http.Response Body if it receives an error.

func (BaseClient) GetCustomModel

func (client BaseClient) GetCustomModel(ctx context.Context, ID uuid.UUID) (result ModelResult, err error)

GetCustomModel get information about a model. Parameters: ID - model identifier.

func (BaseClient) GetCustomModelPreparer

func (client BaseClient) GetCustomModelPreparer(ctx context.Context, ID uuid.UUID) (*http.Request, error)

GetCustomModelPreparer prepares the GetCustomModel request.

func (BaseClient) GetCustomModelResponder

func (client BaseClient) GetCustomModelResponder(resp *http.Response) (result ModelResult, err error)

GetCustomModelResponder handles the response to the GetCustomModel request. The method always closes the http.Response Body.

func (BaseClient) GetCustomModelSender

func (client BaseClient) GetCustomModelSender(req *http.Request) (*http.Response, error)

GetCustomModelSender sends the GetCustomModel request. The method will close the http.Response Body if it receives an error.

func (BaseClient) GetCustomModels

func (client BaseClient) GetCustomModels(ctx context.Context) (result ModelsResult, err error)

GetCustomModels get information about all trained custom models

func (BaseClient) GetCustomModelsPreparer

func (client BaseClient) GetCustomModelsPreparer(ctx context.Context) (*http.Request, error)

GetCustomModelsPreparer prepares the GetCustomModels request.

func (BaseClient) GetCustomModelsResponder

func (client BaseClient) GetCustomModelsResponder(resp *http.Response) (result ModelsResult, err error)

GetCustomModelsResponder handles the response to the GetCustomModels request. The method always closes the http.Response Body.

func (BaseClient) GetCustomModelsSender

func (client BaseClient) GetCustomModelsSender(req *http.Request) (*http.Response, error)

GetCustomModelsSender sends the GetCustomModels request. The method will close the http.Response Body if it receives an error.

func (BaseClient) GetExtractedKeys

func (client BaseClient) GetExtractedKeys(ctx context.Context, ID uuid.UUID) (result KeysResult, err error)

GetExtractedKeys retrieve the keys that were extracted during the training of the specified model. Parameters: ID - model identifier.

func (BaseClient) GetExtractedKeysPreparer

func (client BaseClient) GetExtractedKeysPreparer(ctx context.Context, ID uuid.UUID) (*http.Request, error)

GetExtractedKeysPreparer prepares the GetExtractedKeys request.

func (BaseClient) GetExtractedKeysResponder

func (client BaseClient) GetExtractedKeysResponder(resp *http.Response) (result KeysResult, err error)

GetExtractedKeysResponder handles the response to the GetExtractedKeys request. The method always closes the http.Response Body.

func (BaseClient) GetExtractedKeysSender

func (client BaseClient) GetExtractedKeysSender(req *http.Request) (*http.Response, error)

GetExtractedKeysSender sends the GetExtractedKeys request. The method will close the http.Response Body if it receives an error.

func (BaseClient) TrainCustomModel

func (client BaseClient) TrainCustomModel(ctx context.Context, trainRequest TrainRequest) (result TrainResult, err error)

TrainCustomModel create and train a custom model. The train request must include a source parameter that is either an externally accessible Azure Storage blob container Uri (preferably a Shared Access Signature Uri) or valid path to a data folder in a locally mounted drive. When local paths are specified, they must follow the Linux/Unix path format and be an absolute path rooted to the input mount configuration setting value e.g., if '{Mounts:Input}' configuration setting value is '/input' then a valid source path would be '/input/contosodataset'. All data to be trained is expected to be directly under the source folder. Subfolders are not supported. Models are trained using documents that are of the following content type - 'application/pdf', 'image/jpeg' and 'image/png'." Other type of content is ignored. Parameters: trainRequest - request object for training.

func (BaseClient) TrainCustomModelPreparer

func (client BaseClient) TrainCustomModelPreparer(ctx context.Context, trainRequest TrainRequest) (*http.Request, error)

TrainCustomModelPreparer prepares the TrainCustomModel request.

func (BaseClient) TrainCustomModelResponder

func (client BaseClient) TrainCustomModelResponder(resp *http.Response) (result TrainResult, err error)

TrainCustomModelResponder handles the response to the TrainCustomModel request. The method always closes the http.Response Body.

func (BaseClient) TrainCustomModelSender

func (client BaseClient) TrainCustomModelSender(req *http.Request) (*http.Response, error)

TrainCustomModelSender sends the TrainCustomModel request. The method will close the http.Response Body if it receives an error.

type ErrorInformation

type ErrorInformation struct {
	Code       *string     `json:"code,omitempty"`
	InnerError *InnerError `json:"innerError,omitempty"`
	Message    *string     `json:"message,omitempty"`
}

ErrorInformation ...

type ErrorResponse

type ErrorResponse struct {
	Error *ErrorInformation `json:"error,omitempty"`
}

ErrorResponse ...

type ExtractedKeyValuePair

type ExtractedKeyValuePair struct {
	// Key - List of tokens for the extracted key in a key-value pair.
	Key *[]ExtractedToken `json:"key,omitempty"`
	// Value - List of tokens for the extracted value in a key-value pair.
	Value *[]ExtractedToken `json:"value,omitempty"`
}

ExtractedKeyValuePair representation of a key-value pair as a list of key and value tokens.

type ExtractedPage

type ExtractedPage struct {
	// Number - Page number.
	Number *int32 `json:"number,omitempty"`
	// Height - Height of the page (in pixels).
	Height *int32 `json:"height,omitempty"`
	// Width - Width of the page (in pixels).
	Width *int32 `json:"width,omitempty"`
	// ClusterID - Cluster identifier.
	ClusterID *int32 `json:"clusterId,omitempty"`
	// KeyValuePairs - List of Key-Value pairs extracted from the page.
	KeyValuePairs *[]ExtractedKeyValuePair `json:"keyValuePairs,omitempty"`
	// Tables - List of Tables and their information extracted from the page.
	Tables *[]ExtractedTable `json:"tables,omitempty"`
}

ExtractedPage extraction information of a single page in a with a document.

type ExtractedTable

type ExtractedTable struct {
	// ID - Table identifier.
	ID *string `json:"id,omitempty"`
	// Columns - List of columns contained in the table.
	Columns *[]ExtractedTableColumn `json:"columns,omitempty"`
}

ExtractedTable extraction information about a table contained in a page.

type ExtractedTableColumn

type ExtractedTableColumn struct {
	// Header - List of extracted tokens for the column header.
	Header *[]ExtractedToken `json:"header,omitempty"`
	// Entries - Extracted text for each cell of a column. Each cell
	// in the column can have a list of one or more tokens.
	Entries *[][]ExtractedToken `json:"entries,omitempty"`
}

ExtractedTableColumn extraction information of a column in a table.

type ExtractedToken

type ExtractedToken struct {
	// Text - String value of the extracted text.
	Text *string `json:"text,omitempty"`
	// BoundingBox - Bounding box of the extracted text. Represents the
	// location of the extracted text as a pair of
	// cartesian co-ordinates. The co-ordinate pairs are arranged by
	// top-left, top-right, bottom-right and bottom-left endpoints box
	// with origin reference from the bottom-left of the page.
	BoundingBox *[]float64 `json:"boundingBox,omitempty"`
	// Confidence - A measure of accuracy of the extracted text.
	Confidence *float64 `json:"confidence,omitempty"`
}

ExtractedToken canonical representation of single extracted text.

type FormDocumentReport

type FormDocumentReport struct {
	// DocumentName - Reference to the data that the report is for.
	DocumentName *string `json:"documentName,omitempty"`
	// Pages - Total number of pages trained on.
	Pages *int32 `json:"pages,omitempty"`
	// Errors - List of errors per page.
	Errors *[]string `json:"errors,omitempty"`
	// Status - Status of the training operation. Possible values include: 'Success', 'PartialSuccess', 'Failure'
	Status Status `json:"status,omitempty"`
}

FormDocumentReport ...

type FormOperationError

type FormOperationError struct {
	// ErrorMessage - Message reported during the train operation.
	ErrorMessage *string `json:"errorMessage,omitempty"`
}

FormOperationError error reported during an operation.

type InnerError

type InnerError struct {
	RequestID *string `json:"requestId,omitempty"`
}

InnerError ...

type KeysResult

type KeysResult struct {
	autorest.Response `json:"-"`
	// Clusters - Object mapping ClusterIds to Key lists.
	Clusters map[string][]string `json:"clusters"`
}

KeysResult result of an operation to get the keys extracted by a model.

func (KeysResult) MarshalJSON

func (kr KeysResult) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for KeysResult.

type ModelResult

type ModelResult struct {
	autorest.Response `json:"-"`
	// ModelID - Get or set model identifier.
	ModelID *uuid.UUID `json:"modelId,omitempty"`
	// Status - Get or set the status of model. Possible values include: 'Created', 'Ready', 'Invalid'
	Status Status1 `json:"status,omitempty"`
	// CreatedDateTime - Get or set the created date time of the model.
	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
	// LastUpdatedDateTime - Get or set the model last updated datetime.
	LastUpdatedDateTime *date.Time `json:"lastUpdatedDateTime,omitempty"`
}

ModelResult result of a model status query operation.

type ModelsResult

type ModelsResult struct {
	autorest.Response `json:"-"`
	// ModelsProperty - Collection of models.
	ModelsProperty *[]ModelResult `json:"models,omitempty"`
}

ModelsResult result of query operation to fetch multiple models.

type Status

type Status string

Status enumerates the values for status.

const (
	// Failure ...
	Failure Status = "failure"
	// PartialSuccess ...
	PartialSuccess Status = "partialSuccess"
	// Success ...
	Success Status = "success"
)

func PossibleStatusValues

func PossibleStatusValues() []Status

PossibleStatusValues returns an array of possible values for the Status const type.

type Status1

type Status1 string

Status1 enumerates the values for status 1.

const (
	// Created ...
	Created Status1 = "created"
	// Invalid ...
	Invalid Status1 = "invalid"
	// Ready ...
	Ready Status1 = "ready"
)

func PossibleStatus1Values

func PossibleStatus1Values() []Status1

PossibleStatus1Values returns an array of possible values for the Status1 const type.

type Status2

type Status2 string

Status2 enumerates the values for status 2.

const (
	// Status2Failure ...
	Status2Failure Status2 = "failure"
	// Status2PartialSuccess ...
	Status2PartialSuccess Status2 = "partialSuccess"
	// Status2Success ...
	Status2Success Status2 = "success"
)

func PossibleStatus2Values

func PossibleStatus2Values() []Status2

PossibleStatus2Values returns an array of possible values for the Status2 const type.

type TrainRequest

type TrainRequest struct {
	// Source - Get or set source path.
	Source *string `json:"source,omitempty"`
}

TrainRequest contract to initiate a train request.

type TrainResult

type TrainResult struct {
	autorest.Response `json:"-"`
	// ModelID - Identifier of the model.
	ModelID *uuid.UUID `json:"modelId,omitempty"`
	// TrainingDocuments - List of documents used to train the model and the
	// train operation error reported by each.
	TrainingDocuments *[]FormDocumentReport `json:"trainingDocuments,omitempty"`
	// Errors - Errors returned during the training operation.
	Errors *[]FormOperationError `json:"errors,omitempty"`
}

TrainResult response of the Train API call.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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