-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[TA] Added MultiCategoryClassify Functionality #24237
[TA] Added MultiCategoryClassify Functionality #24237
Conversation
DocumentClassificationCollection --> ClassificationCategoryCollection
cb2ad35
to
fc0f362
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET LGTM
}; | ||
|
||
// Set project and deployment names of the target model | ||
#if SNIPPET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like there is no snippet defined in this class, so this section of code is not necessary. you could just do
string projectName = TestEnvironment.MultiClassificationProjectName;
string deploymentName = TestEnvironment.MultiClassificationDeploymentName;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the other 3 sample classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing, removed them.
I had them there because I remember in DT there were some samples where we wanted to have the #if SNIPPET
directives for clarity, even when the code was not actually used in a snippet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair. DT was more complex as it required function calls to get the storage setup. here it is just a string so user can follow easier
{ | ||
foreach (MultiCategoryClassifyResult documentResults in classificationActionResults.DocumentsResults) | ||
{ | ||
if (documentResults.ClassificationCategories.Count > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought arch board feedback was to rename this property to classifications
? @mssfang
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out. I seem to have missed this rename in SingleCategoryClassifyResult
as well.
SingleCategoryClassifyResult.ClassificationCategory
-> SingleCategoryClassifyResult.Classification
MultiCategoryClassifyResult.ClassificationCategories
-> MultiCategoryClassifyResult.Classifications
new MultiCategoryClassifyAction(FakeProjectName, FakeDeploymentName), | ||
new MultiCategoryClassifyAction(FakeProjectName, FakeDeploymentName) | ||
{ | ||
DisableServiceLogs = true | ||
} | ||
}, | ||
}; | ||
|
||
ArgumentException ex = Assert.ThrowsAsync<ArgumentException>(async () => await client.StartAnalyzeActionsAsync(documents, batchActions)); | ||
Assert.AreEqual("Multiple of the same action is not currently supported.", ex.Message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this test should work if different values for project name / deployment name are passed for each action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not following the logic we currently have in the .NET SDK.
I prefer to leave this as is so we can make progress in this PR, work on the custom entities PR, and once those 2 are merged, then focus on the work on #24430
Rename property ClassificationCategory -> Classification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! :)
* [TextAnalytics] Generated client from 3.2-preview.2 swagger (#23536) * [TA] Added SingleCategoryClassify functionality (#24235) * [TA] Added MultiCategoryClassify Functionality (#24237) * [TA] Added RecognizeCustomEntities Functionality (#24245) * [TA] Expose ActionName and enable multiple actions from same type (#24619) * Rerecorded all tests excluding AAD ones (#24913) * re-record AAD tests (#24919) * [TA] Enable CI for live tests for custom features (#24916) * add comments Co-authored-by: Caio Saldanha <camaiaor@microsoft.com> Co-authored-by: Ahmed Leithy <v-aleithy@microsoft.com> Co-authored-by: Salah Mostafa <zulamostafa@gmail.com> Co-authored-by: Salah Mostafa <v-samostafa@microsoft.com>
This PR contains the implementation of the Multi Category Classify API interface as explained in #24062. Renames post the meeting with the architecture board have been taken into consideration in this PR.
The CI pipeline currently fails because:
The tests can be rerecorded in another PR at a later date.