Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
- Replace parameters `filePrefix` and `includeSubFolders` with `TrainingFileFilter` model
- Rename AccountProperties `count` and `limit` to `customModelCount` and `customModelLimit`

### New Features
- Support to copy a custom model from one Form Recognizer resource to another

## 1.0.0-beta.2 (2020-05-06)
- Fixed Receipt type bug to select the valueString field via fieldValue.
- Rename `apiKey()` to `credential()` on FormRecognizerClientBuilder.
Expand Down
5 changes: 4 additions & 1 deletion sdk/formrecognizer/azure-ai-formrecognizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ The [FormTrainingClient][form_training_sync_client] and
A `CustomFormModel` is returned indicating the fields the model will extract, as well as the estimated accuracy for
each field. See the [service's documents][fr_train_with_labels] for a more detailed explanation.
- Managing models created in your account.
- Copying a custom model from one Form Recognizer resource to another.

Please note that models can also be trained using a graphical user interface such as the [Form Recognizer Labeling Tool][fr_labeling_tool].

Expand All @@ -139,7 +140,6 @@ The following section provides several code snippets covering some of the most c
* [Train a Model](#train-a-model "Train a model")
* [Manage Your Models](#manage-your-models "Manage Your Models")


### Recognize Forms Using a Custom Model
Recognize name/value pairs and table data from forms. These models are trained with your own data,
so they're tailored to your forms. You should only recognize forms of the same form type that the custom model was trained on.
Expand Down Expand Up @@ -325,6 +325,7 @@ The async versions of the samples show asynchronous operations with Form Recogni
* Train a model without labels: [TrainModelWithoutLabels][train_unlabeled_model], ([async][train_unlabeled_model_async])
* Train a model with labels: [TrainModelWithLabels][train_labeled_model], ([async][train_labeled_model_async])
* Manage custom models: [ManageCustomModels][manage_custom_models], ([async_version][manage_custom_models_async])
* Copy a model between Form Recognizer resources: [CopyModel][copy_model] ([async_version][copy_model_async])

### Additional documentation

Expand Down Expand Up @@ -383,6 +384,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[train_unlabeled_model_async]: src/samples/java/com/azure/ai/formrecognizer/TrainModelWithoutLabelsAsync.java
[train_labeled_model]: src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabels.java
[train_labeled_model_async]: src/samples/java/com/azure/ai/formrecognizer/TrainModelWithLabelsAsync.java
[copy_model]: src/samples/java/com/azure/ai/formrecognizer/CopyModel.java
[copy_model_async]: src/samples/java/com/azure/ai/formrecognizer/CopyModelAsync.java
[service_access]: https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account?tabs=multiservice%2Cwindows
[service_doc_train_unlabeled]: https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/overview#train-without-labels
[service_doc_train_labeled]: https://docs.microsoft.com/en-us/azure/cognitive-services/form-recognizer/overview#train-with-labels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public FormRecognizerAsyncClient buildAsyncClient() {
final FormRecognizerClientImpl formRecognizerAPI = new FormRecognizerClientImplBuilder()
.endpoint(endpoint)
.pipeline(pipeline)
.build();
.buildClient();

return new FormRecognizerAsyncClient(formRecognizerAPI, serviceVersion);
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,37 @@
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;

/**
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All files under implementation/ are auto-generated and can be skipped for review.

* A builder for creating a new instance of the FormRecognizerClient type.
*/
/** A builder for creating a new instance of the FormRecognizerClient type. */
@ServiceClientBuilder(serviceClients = {FormRecognizerClientImpl.class})
public final class FormRecognizerClientImplBuilder {

/*
* Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).
* Supported Cognitive Services endpoints (protocol and hostname, for
* example: https://westus2.api.cognitive.microsoft.com).
*/
private String endpoint;
/*
* The HTTP pipeline to send requests through
*/
private HttpPipeline pipeline;

/**
* Sets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com).
* Sets Supported Cognitive Services endpoints (protocol and hostname, for example:
* https://westus2.api.cognitive.microsoft.com).
*
* @param endpoint the endpoint value.
*
* @return the FormRecognizerClientImplBuilder.
* @return the FormRecognizerClientBuilder.
*/
public FormRecognizerClientImplBuilder endpoint(String endpoint) {
this.endpoint = endpoint;
return this;
}

/*
* The HTTP pipeline to send requests through
*/
private HttpPipeline pipeline;

/**
* Sets The HTTP pipeline to send requests through.
*
* @param pipeline the pipeline value.
*
* @return the FormRecognizerClientImplBuilder.
* @return the FormRecognizerClientBuilder.
*/
public FormRecognizerClientImplBuilder pipeline(HttpPipeline pipeline) {
this.pipeline = pipeline;
Expand All @@ -55,9 +53,12 @@ public FormRecognizerClientImplBuilder pipeline(HttpPipeline pipeline) {
*
* @return an instance of FormRecognizerClientImpl.
*/
public FormRecognizerClientImpl build() {
public FormRecognizerClientImpl buildClient() {
if (pipeline == null) {
this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()).build();
this.pipeline =
new HttpPipelineBuilder()
.policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
.build();
}
FormRecognizerClientImpl client = new FormRecognizerClientImpl(pipeline);
client.setEndpoint(this.endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* The AnalyzeLayoutAsyncHeaders model.
*/
/** The AnalyzeLayoutAsyncHeaders model. */
@Fluent
public final class AnalyzeLayoutAsyncHeaders {
/*
Expand All @@ -20,7 +18,7 @@ public final class AnalyzeLayoutAsyncHeaders {

/**
* Get the operationLocation property: The Operation-Location property.
*
*
* @return the operationLocation value.
*/
public String getOperationLocation() {
Expand All @@ -29,7 +27,7 @@ public String getOperationLocation() {

/**
* Set the operationLocation property: The Operation-Location property.
*
*
* @param operationLocation the operationLocation value to set.
* @return the AnalyzeLayoutAsyncHeaders object itself.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@
import com.azure.core.http.HttpRequest;
import com.azure.core.http.rest.ResponseBase;

/**
* Contains all response data for the analyzeLayoutAsync operation.
*/
/** Contains all response data for the analyzeLayoutAsync operation. */
public final class AnalyzeLayoutAsyncResponse extends ResponseBase<AnalyzeLayoutAsyncHeaders, Void> {
/**
* Creates an instance of AnalyzeLayoutAsyncResponse.
*
*
* @param request the request which resulted in this AnalyzeLayoutAsyncResponse.
* @param statusCode the status code of the HTTP response.
* @param rawHeaders the raw headers of the HTTP response.
* @param value the deserialized value of the HTTP response.
* @param headers the deserialized headers of the HTTP response.
*/
public AnalyzeLayoutAsyncResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, AnalyzeLayoutAsyncHeaders headers) {
public AnalyzeLayoutAsyncResponse(
HttpRequest request,
int statusCode,
HttpHeaders rawHeaders,
Void value,
AnalyzeLayoutAsyncHeaders headers) {
super(request, statusCode, rawHeaders, value, headers);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/**
* The AnalyzeOperationResult model.
*/
/** The AnalyzeOperationResult model. */
@Fluent
public final class AnalyzeOperationResult {
/*
Expand Down Expand Up @@ -39,7 +37,7 @@ public final class AnalyzeOperationResult {

/**
* Get the status property: Operation status.
*
*
* @return the status value.
*/
public OperationStatus getStatus() {
Expand All @@ -48,7 +46,7 @@ public OperationStatus getStatus() {

/**
* Set the status property: Operation status.
*
*
* @param status the status value to set.
* @return the AnalyzeOperationResult object itself.
*/
Expand All @@ -58,19 +56,17 @@ public AnalyzeOperationResult setStatus(OperationStatus status) {
}

/**
* Get the createdDateTime property: Date and time (UTC) when the analyze
* operation was submitted.
*
* Get the createdDateTime property: Date and time (UTC) when the analyze operation was submitted.
*
* @return the createdDateTime value.
*/
public OffsetDateTime getCreatedDateTime() {
return this.createdDateTime;
}

/**
* Set the createdDateTime property: Date and time (UTC) when the analyze
* operation was submitted.
*
* Set the createdDateTime property: Date and time (UTC) when the analyze operation was submitted.
*
* @param createdDateTime the createdDateTime value to set.
* @return the AnalyzeOperationResult object itself.
*/
Expand All @@ -80,19 +76,17 @@ public AnalyzeOperationResult setCreatedDateTime(OffsetDateTime createdDateTime)
}

/**
* Get the lastUpdatedDateTime property: Date and time (UTC) when the
* status was last updated.
*
* Get the lastUpdatedDateTime property: Date and time (UTC) when the status was last updated.
*
* @return the lastUpdatedDateTime value.
*/
public OffsetDateTime getLastUpdatedDateTime() {
return this.lastUpdatedDateTime;
}

/**
* Set the lastUpdatedDateTime property: Date and time (UTC) when the
* status was last updated.
*
* Set the lastUpdatedDateTime property: Date and time (UTC) when the status was last updated.
*
* @param lastUpdatedDateTime the lastUpdatedDateTime value to set.
* @return the AnalyzeOperationResult object itself.
*/
Expand All @@ -103,7 +97,7 @@ public AnalyzeOperationResult setLastUpdatedDateTime(OffsetDateTime lastUpdatedD

/**
* Get the analyzeResult property: Results of the analyze operation.
*
*
* @return the analyzeResult value.
*/
public AnalyzeResult getAnalyzeResult() {
Expand All @@ -112,7 +106,7 @@ public AnalyzeResult getAnalyzeResult() {

/**
* Set the analyzeResult property: Results of the analyze operation.
*
*
* @param analyzeResult the analyzeResult value to set.
* @return the AnalyzeOperationResult object itself.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* The AnalyzeReceiptAsyncHeaders model.
*/
/** The AnalyzeReceiptAsyncHeaders model. */
@Fluent
public final class AnalyzeReceiptAsyncHeaders {
/*
Expand All @@ -20,7 +18,7 @@ public final class AnalyzeReceiptAsyncHeaders {

/**
* Get the operationLocation property: The Operation-Location property.
*
*
* @return the operationLocation value.
*/
public String getOperationLocation() {
Expand All @@ -29,7 +27,7 @@ public String getOperationLocation() {

/**
* Set the operationLocation property: The Operation-Location property.
*
*
* @param operationLocation the operationLocation value to set.
* @return the AnalyzeReceiptAsyncHeaders object itself.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@
import com.azure.core.http.HttpRequest;
import com.azure.core.http.rest.ResponseBase;

/**
* Contains all response data for the analyzeReceiptAsync operation.
*/
/** Contains all response data for the analyzeReceiptAsync operation. */
public final class AnalyzeReceiptAsyncResponse extends ResponseBase<AnalyzeReceiptAsyncHeaders, Void> {
/**
* Creates an instance of AnalyzeReceiptAsyncResponse.
*
*
* @param request the request which resulted in this AnalyzeReceiptAsyncResponse.
* @param statusCode the status code of the HTTP response.
* @param rawHeaders the raw headers of the HTTP response.
* @param value the deserialized value of the HTTP response.
* @param headers the deserialized headers of the HTTP response.
*/
public AnalyzeReceiptAsyncResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, AnalyzeReceiptAsyncHeaders headers) {
public AnalyzeReceiptAsyncResponse(
HttpRequest request,
int statusCode,
HttpHeaders rawHeaders,
Void value,
AnalyzeReceiptAsyncHeaders headers) {
super(request, statusCode, rawHeaders, value, headers);
}
}
Loading