-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
BuildModelOptions.ts
72 lines (64 loc) · 2.48 KB
/
BuildModelOptions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { OperationOptions } from "@azure/core-client";
import { DocumentModelOperationState } from "../lro/administration";
import { PollerOptions } from "./PollerOptions";
/**
* Supported model build modes. The model build mode selects the engine that the service uses to train the model based
* on the labeled training data.
*
* The options are:
* - "neural", which yields the highest quality of model that is capable of extracting data from classes of documents
* that have the same structure of data, but different layouts (for example, W2 tax forms, which may vary from company
* to company, but always contain the same information).
* - "template", which requires all documents to have the same fixed layout (template).
*
* Please see the following link for more information: https://aka.ms/azsdk/formrecognizer/buildmode
*/
export type DocumentModelBuildMode =
(typeof DocumentModelBuildMode)[keyof typeof DocumentModelBuildMode];
/**
* Supported values of `DocumentModelBuildMode`.
*/
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const DocumentModelBuildMode = {
/**
* A mode that builds a model assuming that documents all follow the same, fixed template layout (the same relative
* positioning of fields between documents).
*/
Template: "template",
/**
* A mode that uses a neural engine to extract fields, allowing for documents that have different visual appearances,
* but that contain the same information.
*/
Neural: "neural",
} as const;
/**
* Options common to all operations that define new models, such as `beginBuildDocumentModel`,
* `beginComposeDocumentModel`, and `getCopyAuthorization`.
*/
export interface CommonModelCreationOptions {
/**
* A textual description of the model (can be any text).
*/
description?: string;
/**
* Additional, user-specified key-value pairs to associate with the model as persistent metadata.
*/
tags?: Record<string, string>;
}
/**
* Options for the model creation operation.
*/
export interface CreateDocumentModelOptions
extends OperationOptions,
CommonModelCreationOptions,
PollerOptions<DocumentModelOperationState> {}
/**
* Options for the model build operation.
*/
export interface BeginBuildDocumentModelOptions extends CreateDocumentModelOptions {}
/**
* Options for the model compose operation.
*/
export interface BeginComposeDocumentModelOptions extends CreateDocumentModelOptions {}