No Resolutions support for named entity recognition

Kaushal Shastri 25 Reputation points
2023-01-26T19:36:28.3+00:00

Using the cognitive services NER Quickstart I am testing a sentence such as "This is 5mm in length". Although it resolves to Quantity category, there is no resolutions support to indicate unit of mm and value of 5. Documentation indicates this should be supported. Not sure what I am missing.

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,628 questions
{count} votes

Accepted answer
  1. VasaviLankipalle-MSFT 18,676 Reputation points Moderator
    2023-01-28T01:17:00.9033333+00:00

    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:
    User's image

    I hope this helps.

    Regards,
    Vasavi

    -Please kindly accept the answer if you feel helpful to support the community, thanks.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.