Hi @Kaushal Shastri , Thanks for sharing that with us.
As I mentioned earlier, entity resolutions are supported only in api-version=2022-10-01-preview and "modelVersion": "2022-10-01-preview". So, we need to request the modelVersion: 2022-10-01-preview in SDK to get the Entity resolution in the response.
I'm following the sample code. The below modelversion code is added to the Request option object.
TextAnalyticsRequestOptions options = new() { IncludeStatistics = true };
options.ModelVersion= "2022-10-01-preview";
Response<RecognizeEntitiesResultCollection> response = client.RecognizeEntitiesBatch(documents, options:options);
RecognizeEntitiesResultCollection entitiesInDocuments = response.Value;
Please keep in mind that there are various types of Resolutions. LengthResolution is used here to outline your example.
foreach (BaseResolution resolution in entity.Resolutions){
if(resolution is LengthResolution lengthResolution)
{
Console.WriteLine($" Unit: {lengthResolution.Unit} ");
Console.WriteLine($" Value: {lengthResolution.Value} ");
}
}
Then the Output looks something like this:
I hope this helps.
Regards,
Vasavi
-Please kindly accept the answer if you feel helpful to support the community, thanks.