Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TextAnalytics] Implement Recognize Custom Entities API #24054

Closed
kinelski opened this issue Sep 16, 2021 · 0 comments
Closed

[TextAnalytics] Implement Recognize Custom Entities API #24054

kinelski opened this issue Sep 16, 2021 · 0 comments
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Cognitive - Text Analytics

Comments

@kinelski
Copy link
Member

kinelski commented Sep 16, 2021

Issue

We must implement the new Recognize Custom Entities API following the design presented in: apiview

This new feature will be added as one of the actions in the Analyze API.

Usage example:

var documents = new List<string>() { "There are so many ways of arranging a deck of cards that, after shuffling it, it's almost guaranteed that the resulting sequence of cards has never appeared in the history of humanity." }

TextAnalyticsActions actions = new TextAnalyticsActions()
{
    RecognizeCustomEntitiesActions =
    {
        new RecognizeCustomEntitiesAction("<project-name>", "<deployment-name>")
    }
};

AnalyzeActionsOperation operation = await client.StartAnalyzeActionsAsync(documents, actions);

await operation.WaitForCompletionAsync();

AnalyzeActionsResult actionsResult = operation.Value;
IReadOnlyCollection<RecognizeCustomEntitiesActionResult> results = actionsResult.RecognizeCustomEntitiesResults;

Goals

Note: it's strongly recommended to use the already implemented Extractive Summarization API as a reference. It's also part of the Analyze API, and the general structures of models/tests/samples are the same.

Implementation

  • Make sure the generated code is up to date with the latest swagger file.
  • Add new models/properties and their implementations.

Tests

Note: currently we're still waiting for the service team to provide a resource we can use for testing, so live testing cannot be accomplished until then.

For each one of the tasks below, a "reference" test has been added so it can be used as a guide during implementation. The general structure of the suggested reference tests are very similar to the ones we want to implement.

  • Add live tests for the new Recognize Custom Entities API. Reference test class: ExtractSummaryTests.

  • Add new tests in AnalyzeMockTests:

    • Assert loggingOptOut JSON property is sent when using RecognizeCustomEntitiesAction.DisableServiceLogs. Reference test: AnalyzeOperationExtractSummaryWithDisableServiceLogs.
    • Assert that sending two RecognizeCustomEntitiesAction in the same request throws an ArgumentException. Reference test: AnalyzeOperationExtractSummaryWithTwoActions.
  • Update existing tests in AnalyzeMockTests:

    • Modify AnalyzeOperationWithActionsError to include the new task used in the Recognize Custom Entities API.
  • Update existing tests in AnalyzeOperationTests:

    • Modify AnalyzeOperationTest to include the new RecognizeCustomEntitiesAction.

Documentation and Samples

  • Add a new sample for the Recognize Custom Entities API.
  • Consider adding a new section to the README as well to illustrate the usage of the new API.
  • Update changelogs.
@kinelski kinelski added Client This issue points to a problem in the data-plane of the library. Cognitive - Text Analytics labels Sep 16, 2021
@kinelski kinelski added this to the [2021] October milestone Sep 16, 2021
@maririos maririos added the blocking-release Blocks release label Oct 5, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Cognitive - Text Analytics
Projects
None yet
Development

No branches or pull requests

2 participants