Skip to content

Commit

Permalink
[FR] Update docstrings (#17345)
Browse files Browse the repository at this point in the history
* first rounds:

* improve docstring and cleanup some code

* PR feedback
maririos authored Dec 5, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 8f9dcd1 commit 680f52a
Showing 34 changed files with 160 additions and 92 deletions.
2 changes: 1 addition & 1 deletion sdk/formrecognizer/Azure.AI.FormRecognizer/README.md
Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@ var client = new FormRecognizerClient(new Uri(endpoint), new DefaultAzureCredent
- Training custom models to recognize specific fields and values you specify by labeling your custom forms. A `CustomFormModel` is returned indicating the fields the model will extract, as well as the estimated accuracy for each field.
- Managing models created in your account.
- Copying a custom model from one Form Recognizer resource to another.
- Creating a composed model from a collection of existing trained models with labels.
- Creating a composed model from a collection of existing models trained with labels.

See examples for [Train a Model](#train-a-model) and [Manage Custom Models](#manage-custom-models).

Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
namespace Azure.AI.FormRecognizer.Training
{
/// <summary>
/// Contains general information about a Cognitive Services Account, such as the number
/// Contains general information about the Form Recognizer resource, such as the number
/// of models and account limits.
/// </summary>
public class AccountProperties
@@ -21,20 +21,20 @@ internal AccountProperties(ModelsSummary summary)
/// Initializes a new instance of the <see cref="AccountProperties"/> class.
/// </summary>
/// <param name="customModelCount">The current count of trained custom models.</param>
/// <param name="customModelLimit">The maximum number of models that can be trained for this subscription.</param>
/// <param name="customModelLimit">The maximum number of models that can be trained for this account.</param>
internal AccountProperties(int customModelCount, int customModelLimit)
{
CustomModelCount = customModelCount;
CustomModelLimit = customModelLimit;
}

/// <summary>
/// The current count of trained custom models.
/// The current count of trained custom models in this account.
/// </summary>
public int CustomModelCount { get; }

/// <summary>
/// The maximum number of models that can be trained for this subscription.
/// The maximum number of models that can be trained for this account.
/// </summary>
public int CustomModelLimit { get; }
}
Original file line number Diff line number Diff line change
@@ -78,7 +78,8 @@ public override CustomFormModelInfo Value
public override bool HasValue => _value != null;

/// <summary>
/// Initializes a new instance of the <see cref="CopyModelOperation"/> class.
/// Initializes a new instance of the <see cref="CopyModelOperation"/> class which
/// tracks the status of the long-running operation for copying a custom model into a target Form Recognizer resource.
/// </summary>
/// <param name="operationId">The ID of this operation.</param>
/// <param name="targetModelId">Model ID in the target Form Recognizer resource.</param>
Original file line number Diff line number Diff line change
@@ -6,14 +6,17 @@
namespace Azure.AI.FormRecognizer.Training
{
/// <summary>
/// Tracks the status of a long-running operation for training a model from a collection of custom forms.
/// Tracks the status of a long-running operation for creating a composed model from a
/// collection of existing models trained with labels.
/// </summary>
public class CreateComposedModelOperation : CreateCustomFormModelOperation
{
internal CreateComposedModelOperation(string location, FormRecognizerRestClient allOperations, ClientDiagnostics diagnostics) : base(location, allOperations, diagnostics) { }

/// <summary>
/// Initializes a new instance of the <see cref="TrainingOperation"/> class.
/// Initializes a new instance of the <see cref="CreateComposedModelOperation"/> class which
/// tracks the status of a long-running operation for creating a composed model from a
/// collection of existing models trained with labels.
/// </summary>
/// <param name="operationId">The ID of this operation.</param>
/// <param name="client">The client used to check for completion.</param>
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
namespace Azure.AI.FormRecognizer.Training
{
/// <summary>
/// Tracks the status of a long-running operation for training a model from a collection of custom forms.
/// Tracks the status of a long-running operation for creating a custom model.
/// </summary>
public class CreateCustomFormModelOperation : Operation<CustomFormModel>
{
@@ -73,7 +73,7 @@ public override CustomFormModel Value
/// </summary>
/// <remarks>
/// The last response returned from the server during the lifecycle of this instance.
/// An instance of <see cref="TrainingOperation"/> sends requests to a server in UpdateStatusAsync, UpdateStatus, and other methods.
/// An instance of <see cref="CreateCustomFormModelOperation"/> sends requests to a server in UpdateStatusAsync, UpdateStatus, and other methods.
/// Responses from these requests can be accessed using GetRawResponse.
/// </remarks>
public override Response GetRawResponse() => _response;
@@ -116,7 +116,8 @@ internal CreateCustomFormModelOperation(string location, FormRecognizerRestClien
}

/// <summary>
/// Initializes a new instance of the <see cref="TrainingOperation"/> class.
/// Initializes a new instance of the <see cref="CreateCustomFormModelOperation"/> class which
/// tracks the status of a long-running operation for creating a custom model.
/// </summary>
/// <param name="operationId">The ID of this operation.</param>
/// <param name="client">The client used to check for completion.</param>
@@ -159,7 +160,7 @@ private async ValueTask<Response> UpdateStatusAsync(bool async, CancellationToke
{
if (!_hasCompleted)
{
using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(TrainingOperation)}.{nameof(UpdateStatus)}");
using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(CreateCustomFormModelOperation)}.{nameof(UpdateStatus)}");
scope.Start();

try
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ internal CustomFormModel(
public string ModelName { get; }

/// <summary>
/// Model properties, like for example, if a model is composed.
/// Properties of a model, such as whether the model is a composed model or not.
/// </summary>
[CodeGenMember("Attributes")]
public CustomFormModelProperties Properties { get; }
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ internal CustomFormModelInfo(string modelId, CustomFormModelStatus status, DateT
public string ModelName { get; }

/// <summary>
/// Model properties, like for example, if a model is composed.
/// Properties of a model, such as whether the model is a composed model or not.
/// </summary>
[CodeGenMember("Attributes")]
public CustomFormModelProperties Properties { get; }
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@

namespace Azure.AI.FormRecognizer.Training
{
/// <summary>
/// Properties of a model, such as whether the model is a composed model or not.
/// </summary>
[CodeGenModel("Attributes")]
public partial class CustomFormModelProperties
{
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using Azure.Core;

namespace Azure.AI.FormRecognizer.Models
{
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@ public enum FieldValueType
Dictionary,

/// <summary>
/// Used for <see cref="FieldValueSelectionMark"/> type.
/// Used for <see cref="SelectionMarkState"/> type.
/// </summary>
SelectionMark
}
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ namespace Azure.AI.FormRecognizer.Models
{
/// <summary>
/// Represents a form element recognized from the input document. Its text can be a line,
/// a word, the content of a table cell, etc.
/// a word, the content of a table cell, a selection mark, etc.
/// </summary>
public abstract class FormElement
{
Original file line number Diff line number Diff line change
@@ -12,7 +12,8 @@ public class FormField<T>
#pragma warning restore SA1649 // File name should match first type name
{
/// <summary>
/// Initializes a new instance of the <see cref="FormField{T}"/> class.
/// Initializes a new instance of the <see cref="FormField{T}"/> class which
/// represents a field recognized in the input form, where the field's value is of a known type.
/// </summary>
/// <param name="field">The weakly-typed field this instance is associated with.</param>
/// <param name="value">The strongly-typed value of this <see cref="FormField{T}"/>.</param>
7 changes: 4 additions & 3 deletions sdk/formrecognizer/Azure.AI.FormRecognizer/src/FormPage.cs
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@
namespace Azure.AI.FormRecognizer.Models
{
/// <summary>
/// Represents a page recognized from the input document. Contains lines, words, tables and page metadata.
/// Represents a page recognized from the input document. Contains lines, words, tables,
/// selection marks, and page metadata.
/// </summary>
public class FormPage
{
@@ -41,7 +42,7 @@ internal FormPage(PageResult pageResult, IReadOnlyList<ReadResult> readResults,
/// <param name="width">The width of the image/PDF in pixels/inches, respectively.</param>
/// <param name="height">The height of the image/PDF in pixels/inches, respectively.</param>
/// <param name="textAngle">The general orientation of the text in clockwise direction, measured in degrees between (-180, 180].</param>
/// <param name="unit">The unit used by the width, height and <see cref="FieldBoundingBox"/> properties. For images, the unit is &quot;pixel&quot;. For PDF, the unit is &quot;inch&quot;.</param>
/// <param name="unit">The unit used by the width, height and <see cref="FieldBoundingBox"/> properties. For images, the unit is pixel. For PDF, the unit is inch.</param>
/// <param name="lines">A list of recognized lines of text.</param>
/// <param name="tables">A list of recognized tables contained in this page.</param>
/// <param name="selectionMarks">A list of recognized selection marks contained in this page.</param>
@@ -79,7 +80,7 @@ internal FormPage(int pageNumber, float width, float height, float textAngle, Le

/// <summary>
/// The unit used by the width, height and <see cref="FieldBoundingBox"/> properties. For images, the unit is
/// &quot;pixel&quot;. For PDF, the unit is &quot;inch&quot;.
/// pixel. For PDF, the unit is inch.
/// </summary>
public LengthUnit Unit { get; }

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -16,7 +16,8 @@ public class FormRecognizerClientOptions : ClientOptions
internal const ServiceVersion LatestVersion = ServiceVersion.V2_0;

/// <summary>
/// Initializes a new instance of the <see cref="FormRecognizerClientOptions"/> class.
/// Initializes a new instance of the <see cref="FormRecognizerClientOptions"/> class which allows
/// to configure the behavior of the <see cref="FormRecognizerClient" /> or <see cref="FormTrainingClient"/>.
/// </summary>
/// <param name="version">The version of the service to send requests to.</param>
public FormRecognizerClientOptions(ServiceVersion version = LatestVersion)
Original file line number Diff line number Diff line change
@@ -11,15 +11,15 @@
namespace Azure.AI.FormRecognizer.Models
{
/// <summary>
/// A factory that builds Azure.AI.FormRecognizer model types for mocking.
/// A factory that builds Azure.AI.FormRecognizer model types used for mocking.
/// </summary>
public static class FormRecognizerModelFactory
{
/// <summary>
/// Initializes a new instance of the <see cref="Training.AccountProperties"/> class.
/// </summary>
/// <param name="customModelCount">The current count of trained custom models.</param>
/// <param name="customModelLimit">The maximum number of models that can be trained for this subscription.</param>
/// <param name="customModelLimit">The maximum number of models that can be trained for this account.</param>
/// <returns>A new <see cref="Training.AccountProperties"/> instance for mocking.</returns>
public static AccountProperties AccountProperties(int customModelCount, int customModelLimit) =>
new AccountProperties(customModelCount, customModelLimit);
@@ -286,7 +286,7 @@ public static FormLine FormLine(FieldBoundingBox boundingBox, int pageNumber, st
/// <param name="width">The width of the image/PDF in pixels/inches, respectively.</param>
/// <param name="height">The height of the image/PDF in pixels/inches, respectively.</param>
/// <param name="textAngle">The general orientation of the text in clockwise direction, measured in degrees between (-180, 180].</param>
/// <param name="unit">The unit used by the width, height and <see cref="FieldBoundingBox"/> properties. For images, the unit is &quot;pixel&quot;. For PDF, the unit is &quot;inch&quot;.</param>
/// <param name="unit">The unit used by the width, height and <see cref="FieldBoundingBox"/> properties. For images, the unit is pixel. For PDF, the unit is inch.</param>
/// <param name="lines">A list of recognized lines of text.</param>
/// <param name="tables">A list of recognized tables contained in this page.</param>
/// <returns>A new <see cref="FormRecognizer.Models.FormPage"/> instance for mocking.</returns>
@@ -306,7 +306,7 @@ public static FormPage FormPage(int pageNumber, float width, float height, float
/// <param name="width">The width of the image/PDF in pixels/inches, respectively.</param>
/// <param name="height">The height of the image/PDF in pixels/inches, respectively.</param>
/// <param name="textAngle">The general orientation of the text in clockwise direction, measured in degrees between (-180, 180].</param>
/// <param name="unit">The unit used by the width, height and <see cref="FieldBoundingBox"/> properties. For images, the unit is &quot;pixel&quot;. For PDF, the unit is &quot;inch&quot;.</param>
/// <param name="unit">The unit used by the width, height and <see cref="FieldBoundingBox"/> properties. For images, the unit is pixel. For PDF, the unit is inch.</param>
/// <param name="lines">A list of recognized lines of text.</param>
/// <param name="tables">A list of recognized tables contained in this page.</param>
/// <param name="selectionMarks">A list of recognized selection marks contained in this page.</param>
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ internal FormSelectionMark(FieldBoundingBox boundingBox, int pageNumber, string
public float Confidence { get; }

/// <summary>
/// Selection mark state value.
/// Selection mark state value, like Selected or Unselected.
/// </summary>
public SelectionMarkState State { get; }
}
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ internal FormTableCell(FieldBoundingBox boundingBox, int pageNumber, string text

/// <summary>
/// When 'IncludeFieldElements' is set to <c>true</c>, a list of references to
/// the field elements constituting this cell is returned. An empty list otherwise. For calls to recognize content, this
/// the field elements constituting this cell is returned. An empty list otherwise. For calls to Recognize Content, this
/// list is always populated.
/// </summary>
public IReadOnlyList<FormElement> FieldElements { get; }
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ namespace Azure.AI.FormRecognizer.Training
{
/// <summary>
/// The client to use to connect with the Form Recognizer Azure Cognitive Service to train models from
/// custom forms. It also supports listing and deleting trained models, as well as accessing account
/// custom forms. It also supports listing, copying, and deleting trained models, creating composed models, and accessing account
/// properties.
/// </summary>
public class FormTrainingClient
@@ -110,9 +110,10 @@ public FormTrainingClient(Uri endpoint, TokenCredential credential, FormRecogniz
/// </summary>
/// <param name="trainingFilesUri">An externally accessible Azure storage blob container Uri.
/// For more information see <a href="https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data"/>.</param>
/// <param name="useTrainingLabels">If <c>true</c>, use a label file created in the &lt;link-to-label-tool-doc&gt; to provide training-time labels for training a model. If <c>false</c>, the model will be trained from forms only.</param>
/// <param name="useTrainingLabels">If <c>true</c>, corresponding labeled files must exist in the blob container. If <c>false</c>, the model will be trained from forms only.</param>
/// <param name="modelName">An optional, user-defined name to associate with the model.</param>
/// <param name="trainingOptions">A set of options available for configuring the training request.</param>
/// <param name="trainingOptions">A set of options available for configuring the training request. For example, set a filter to apply
/// to the documents in the source path for training.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
/// <returns>
/// <para>A <see cref="TrainingOperation"/> to wait on this long-running operation. Its Value upon successful
@@ -152,9 +153,10 @@ public virtual TrainingOperation StartTraining(Uri trainingFilesUri, bool useTra
/// </summary>
/// <param name="trainingFilesUri">An externally accessible Azure storage blob container Uri.
/// For more information see <a href="https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data"/>.</param>
/// <param name="useTrainingLabels">If <c>true</c>, use a label file created in the &lt;link-to-label-tool-doc&gt; to provide training-time labels for training a model. If <c>false</c>, the model will be trained from forms only.</param>
/// <param name="useTrainingLabels">If <c>true</c>, corresponding labeled files must exist in the blob container. If <c>false</c>, the model will be trained from forms only.</param>
/// <param name="modelName">An optional, user-defined name to associate with the model.</param>
/// <param name="trainingOptions">A set of options available for configuring the training request.</param>
/// <param name="trainingOptions">A set of options available for configuring the training request. For example, set a filter to apply
/// to the documents in the source path for training.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
/// <returns>
/// <para>A <see cref="TrainingOperation"/> to wait on this long-running operation. Its Value upon successful
@@ -194,8 +196,9 @@ public virtual async Task<TrainingOperation> StartTrainingAsync(Uri trainingFile
/// </summary>
/// <param name="trainingFilesUri">An externally accessible Azure storage blob container Uri.
/// For more information see <a href="https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data"/>.</param>
/// <param name="useTrainingLabels">If <c>true</c>, use a label file created in the &lt;link-to-label-tool-doc&gt; to provide training-time labels for training a model. If <c>false</c>, the model will be trained from forms only.</param>
/// <param name="trainingOptions">A set of options available for configuring the training request.</param>
/// <param name="useTrainingLabels">If <c>true</c>, corresponding labeled files must exist in the blob container. If <c>false</c>, the model will be trained from forms only.</param>
/// <param name="trainingOptions">A set of options available for configuring the training request. For example, set a filter to apply
/// to the documents in the source path for training.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
/// <returns>
/// <para>A <see cref="TrainingOperation"/> to wait on this long-running operation. Its Value upon successful
@@ -234,8 +237,9 @@ public virtual TrainingOperation StartTraining(Uri trainingFilesUri, bool useTra
/// </summary>
/// <param name="trainingFilesUri">An externally accessible Azure storage blob container Uri.
/// For more information see <a href="https://docs.microsoft.com/azure/cognitive-services/form-recognizer/build-training-data-set#upload-your-training-data"/>.</param>
/// <param name="useTrainingLabels">If <c>true</c>, use a label file created in the &lt;link-to-label-tool-doc&gt; to provide training-time labels for training a model. If <c>false</c>, the model will be trained from forms only.</param>
/// <param name="trainingOptions">A set of options available for configuring the training request.</param>
/// <param name="useTrainingLabels">If <c>true</c>, corresponding labeled files must exist in the blob container. If <c>false</c>, the model will be trained from forms only.</param>
/// <param name="trainingOptions">A set of options available for configuring the training request. For example, set a filter to apply
/// to the documents in the source path for training.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param>
/// <returns>
/// <para>A <see cref="TrainingOperation"/> to wait on this long-running operation. Its Value upon successful
@@ -274,7 +278,7 @@ public virtual async Task<TrainingOperation> StartTrainingAsync(Uri trainingFile
#region Composed model

/// <summary>
/// Creates a composed model from a collection of existing trained models with labels.
/// Creates a composed model from a collection of existing models trained with labels.
/// </summary>
/// <param name="modelIds">List of model ids to use in the composed model.</param>
/// <param name="modelName">An optional, user-defined name to associate with the model.</param>
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -79,7 +78,8 @@ public override RecognizedFormCollection Value
public override Response GetRawResponse() => _response;

/// <summary>
/// Initializes a new instance of the <see cref="RecognizeBusinessCardsOperation"/> class.
/// Initializes a new instance of the <see cref="RecognizeBusinessCardsOperation"/> class which
/// tracks the status of a long-running operation for recognizing values from business cards.
/// </summary>
/// <param name="operationId">The ID of this operation.</param>
/// <param name="client">The client used to check for completion.</param>
Original file line number Diff line number Diff line change
@@ -4,20 +4,25 @@
namespace Azure.AI.FormRecognizer
{
/// <summary>
/// The set of options that can be specified when calling a recognize business cards method
/// to configure the behavior of the request.
/// The set of options that can be specified when calling a Recognize Business Cards method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, the locale of the form, or whether or not to include form elements.
/// </summary>
public class RecognizeBusinessCardsOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizeBusinessCardsOptions"/> class.
/// Initializes a new instance of the <see cref="RecognizeBusinessCardsOptions"/> class which
/// allows to set options that can be specified when calling a Recognize Business Cards method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, the locale of the form, or whether or not to include form elements.
/// </summary>
public RecognizeBusinessCardsOptions()
{
}

/// <summary>
/// Whether or not to include form elements such as lines and words in addition to form fields.
/// Whether or not to include all lines per page and field elements such as lines, words,
/// and selection marks for each form field.
/// </summary>
public bool IncludeFieldElements { get; set; }

Original file line number Diff line number Diff line change
@@ -70,7 +70,8 @@ public override FormPageCollection Value
public override bool HasValue => _value != null;

/// <summary>
/// Initializes a new instance of the <see cref="RecognizeContentOperation"/> class.
/// Initializes a new instance of the <see cref="RecognizeContentOperation"/> class which
/// tracks the status of a long-running operation for recognizing layout elements from forms.
/// </summary>
/// <param name="operationId">The ID of this operation.</param>
/// <param name="client">The client used to check for completion.</param>
Original file line number Diff line number Diff line change
@@ -6,13 +6,17 @@
namespace Azure.AI.FormRecognizer
{
/// <summary>
/// The set of options that can be specified when calling a recognize content method
/// to configure the behavior of the request.
/// The set of options that can be specified when calling a Recognize Content method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, the language of the form, and which pages in a multi-page document to analyze.
/// </summary>
public class RecognizeContentOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizeContentOptions"/> class.
/// Initializes a new instance of the <see cref="RecognizeContentOptions"/> class which
/// allows to set options that can be specified when calling a Recognize Content method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, the language of the form, and which pages in a multi-page document to analyze.
/// </summary>
public RecognizeContentOptions()
{
Original file line number Diff line number Diff line change
@@ -137,7 +137,9 @@ internal RecognizeCustomFormsOperation(FormRecognizerRestClient operations, Clie
}

/// <summary>
/// Initializes a new instance of the <see cref="RecognizeCustomFormsOperation"/> class.
/// Initializes a new instance of the <see cref="RecognizeCustomFormsOperation"/> class which
/// tracks the status of a long-running operation for recognizing fields and other content from forms by using custom
/// trained models.
/// </summary>
/// <param name="operationId">The ID of this operation.</param>
/// <param name="client">The client used to check for completion.</param>
Original file line number Diff line number Diff line change
@@ -4,20 +4,25 @@
namespace Azure.AI.FormRecognizer
{
/// <summary>
/// The set of options that can be specified when calling a recognize custom forms method
/// to configure the behavior of the request.
/// The set of options that can be specified when calling a Recognize Custom Forms method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, or whether or not to include form elements.
/// </summary>
public class RecognizeCustomFormsOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizeCustomFormsOptions"/> class.
/// Initializes a new instance of the <see cref="RecognizeCustomFormsOptions"/> class which
/// allows to set options that can be specified when calling a Recognize Custom Forms method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, or whether or not to include form elements.
/// </summary>
public RecognizeCustomFormsOptions()
{
}

/// <summary>
/// Whether or not to include form elements such as lines and words in addition to form fields.
/// Whether or not to include all lines per page and field elements such as lines, words,
/// and selection marks for each form field.
/// </summary>
public bool IncludeFieldElements { get; set; }

Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -79,7 +78,8 @@ public override RecognizedFormCollection Value
public override Response GetRawResponse() => _response;

/// <summary>
/// Initializes a new instance of the <see cref="RecognizeInvoicesOperation"/> class.
/// Initializes a new instance of the <see cref="RecognizeInvoicesOperation"/> class which
/// tracks the status of a long-running operation for recognizing values from invoices.
/// </summary>
/// <param name="operationId">The ID of this operation.</param>
/// <param name="client">The client used to check for completion.</param>
Original file line number Diff line number Diff line change
@@ -4,20 +4,25 @@
namespace Azure.AI.FormRecognizer
{
/// <summary>
/// The set of options that can be specified when calling a recognize invoices method
/// to configure the behavior of the request.
/// The set of options that can be specified when calling a Recognize Invoices method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, the locale of the form, or whether or not to include form elements.
/// </summary>
public class RecognizeInvoicesOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizeInvoicesOptions"/> class.
/// Initializes a new instance of the <see cref="RecognizeInvoicesOptions"/> class which
/// allows to set options that can be specified when calling a Recognize Invoices method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, the locale of the form, or whether or not to include form elements.
/// </summary>
public RecognizeInvoicesOptions()
{
}

/// <summary>
/// Whether or not to include form elements such as lines and words in addition to form fields.
/// Whether or not to include all lines per page and field elements such as lines, words,
/// and selection marks for each form field.
/// </summary>
public bool IncludeFieldElements { get; set; }

Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@@ -79,7 +78,8 @@ public override RecognizedFormCollection Value
public override Response GetRawResponse() => _response;

/// <summary>
/// Initializes a new instance of the <see cref="RecognizeReceiptsOperation"/> class.
/// Initializes a new instance of the <see cref="RecognizeReceiptsOperation"/> class which
/// tracks the status of a long-running operation for recognizing values from receipts.
/// </summary>
/// <param name="operationId">The ID of this operation.</param>
/// <param name="client">The client used to check for completion.</param>
Original file line number Diff line number Diff line change
@@ -4,20 +4,25 @@
namespace Azure.AI.FormRecognizer
{
/// <summary>
/// The set of options that can be specified when calling a recognize receipt method
/// to configure the behavior of the request.
/// The set of options that can be specified when calling a Recognize Receipts method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, the locale of the form, or whether or not to include form elements.
/// </summary>
public class RecognizeReceiptsOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="RecognizeReceiptsOptions"/> class.
/// Initializes a new instance of the <see cref="RecognizeReceiptsOptions"/> class which
/// allows to set options that can be specified when calling a Recognize Receipts method
/// to configure the behavior of the request. For example, specify the content type of the
/// form, the locale of the form, or whether or not to include form elements.
/// </summary>
public RecognizeReceiptsOptions()
{
}

/// <summary>
/// Whether or not to include form elements such as lines and words in addition to form fields.
/// Whether or not to include all lines per page and field elements such as lines, words,
/// and selection marks for each form field.
/// </summary>
public bool IncludeFieldElements { get; set; }

Original file line number Diff line number Diff line change
@@ -13,7 +13,9 @@ namespace Azure.AI.FormRecognizer.Training
public partial class TrainingFileFilter
{
/// <summary>
/// Initializes a new instance of the <see cref="TrainingFileFilter"/> class.
/// Initializes a new instance of the <see cref="TrainingFileFilter"/> class which is
/// used by the <see cref="FormTrainingClient"/> to filter the documents by name in the
/// source path provided for training.
/// </summary>
public TrainingFileFilter()
{
Original file line number Diff line number Diff line change
@@ -13,7 +13,8 @@ public class TrainingOperation : CreateCustomFormModelOperation
internal TrainingOperation(string location, FormRecognizerRestClient allOperations, ClientDiagnostics diagnostics) : base(location, allOperations, diagnostics) { }

/// <summary>
/// Initializes a new instance of the <see cref="TrainingOperation"/> class.
/// Initializes a new instance of the <see cref="TrainingOperation"/> class which
/// tracks the status of a long-running operation for training a model from a collection of custom forms.
/// </summary>
/// <param name="operationId">The ID of this operation.</param>
/// <param name="client">The client used to check for completion.</param>
Original file line number Diff line number Diff line change
@@ -5,12 +5,16 @@ namespace Azure.AI.FormRecognizer.Training
{
/// <summary>
/// The set of options that can be specified when calling the training method
/// to configure the behavior of the request.
/// to configure the behavior of the request. For example, set a filter to apply
/// to the documents in the source path for training.
/// </summary>
public class TrainingOptions
{
/// <summary>
/// Initializes a new instance of the <see cref="TrainingOptions"/> class.
/// Initializes a new instance of the <see cref="TrainingOptions"/> class which
/// allows to set options that can be specified when calling the training method
/// to configure the behavior of the request. For example, set a filter to apply
/// to the documents for training.
/// </summary>
public TrainingOptions()
{
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ public async Task TrainingOperationCreatesDiagnosticScopeOnUpdate()

await operation.UpdateStatusAsync();

testListener.AssertScope($"{nameof(TrainingOperation)}.{nameof(TrainingOperation.UpdateStatus)}");
testListener.AssertScope($"{nameof(CreateCustomFormModelOperation)}.{nameof(CreateCustomFormModelOperation.UpdateStatus)}");
}

[Test]
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ public partial class FormRecognizerSamples : SamplesBase<FormRecognizerTestEnvir
/// For this sample, you can use the training forms found in the `trainingFiles` folder.
/// Upload the forms to your storage container and then generate a container SAS URL.

/// For more information see https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/overview#custom-models
/// For more information see https://docs.microsoft.com/azure/cognitive-services/form-recognizer/overview#custom-models

[Test]
public async Task OutputModelsTrainedWithLabels()

0 comments on commit 680f52a

Please sign in to comment.