| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System.Collections.Generic; |
| | 5 | |
|
| | 6 | | namespace Azure.AI.FormRecognizer.Training |
| | 7 | | { |
| | 8 | | /// <summary> |
| | 9 | | /// Represents a submodel that extracts fields from a specific type of form. |
| | 10 | | /// </summary> |
| | 11 | | public class CustomFormSubmodel |
| | 12 | | { |
| 148 | 13 | | internal CustomFormSubmodel(string formType, float? accuracy, IReadOnlyDictionary<string, CustomFormModelField> |
| | 14 | | { |
| 148 | 15 | | FormType = formType; |
| 148 | 16 | | Accuracy = accuracy; |
| 148 | 17 | | Fields = fields; |
| 148 | 18 | | } |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// The type of form this submodel recognizes. |
| | 22 | | /// </summary> |
| 36 | 23 | | public string FormType { get; } |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// The mean of the accuracies of this model's <see cref="CustomFormModelField"/> |
| | 27 | | /// instances. |
| | 28 | | /// </summary> |
| 0 | 29 | | public float? Accuracy { get; } |
| | 30 | |
|
| | 31 | | /// <summary> |
| | 32 | | /// A dictionary of the fields that this submodel will recognize from the |
| | 33 | | /// input document. The key is the <see cref="CustomFormModelField.Name"/> |
| | 34 | | /// of the field. For models trained with labels, this is the training-time |
| | 35 | | /// label of the field. For models trained with forms only, a unique name is |
| | 36 | | /// generated for each field. |
| | 37 | | /// </summary> |
| 332 | 38 | | public IReadOnlyDictionary<string, CustomFormModelField> Fields { get; } |
| | 39 | | } |
| | 40 | | } |