Analyze email body and extract key value

Rajeev Kumar Dave 21 Reputation points
2021-01-16T10:02:17.267+00:00

I want to extract key word value like "email", "phone no" , "customer number" , "Invoice". for example

My name is Rajev dave, my in let's see I'll do my customer number is 10400068. My email address is raajeevxxx@Stuff .com a I need to switch the billing information. I have seen bank accounts and I want to make sure you get paid next month. My invoice number is XXXXX

it should Extract.

Name : Rajeev Dave

email : rajeevxxx@Stuff .com

invoice number is XXXXX

customer number is 10400068

Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
376 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,531 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 43,451 Reputation points Microsoft Employee
    2021-01-18T10:13:01.813+00:00

    anonymous userKumarDave-6852 With the above information you can extract entities using the named entity recognition API. In most cases the phone numbers, names, email ids are identified without any additional processing but with numbers like customer id or invoice id you might want to perform some validation of the data as it is returned as a number in the response. In the above case I used your example sentence as is with the API and the following is the response of the entities.

    With a bit of standard formatting in the input to the API you can also readily categorize the numbers as either customer ids or invoice ids based on the offset returned with the numbers. I hope this helps!!

      "documents": [{  
        "id": "2",  
        "entities": [{  
          "text": "Rajev dave",  
          "category": "Person",  
          "offset": 11,  
          "length": 10,  
          "confidenceScore": 0.61  
        }, {  
          "text": "customer",  
          "category": "PersonType",  
          "offset": 50,  
          "length": 8,  
          "confidenceScore": 0.51  
        }, {  
          "text": "10400068",  
          "category": "Quantity",  
          "subcategory": "Number",  
          "offset": 69,  
          "length": 8,  
          "confidenceScore": 0.8  
        }, {  
          "text": "10400068",  
          "category": "Phone Number",  
          "offset": 69,  
          "length": 8,  
          "confidenceScore": 0.8  
        }, {  
          "text": "email",  
          "category": "Skill",  
          "offset": 82,  
          "length": 5,  
          "confidenceScore": 0.8  
        }, {  
          "text": "raajeevxxx@gmail.com",  
          "category": "Email",  
          "offset": 99,  
          "length": 20,  
          "confidenceScore": 0.8  
        }, {  
          "text": "billing information",  
          "category": "Skill",  
          "offset": 143,  
          "length": 19,  
          "confidenceScore": 0.8  
        }, {  
          "text": "next month",  
          "category": "DateTime",  
          "subcategory": "DateRange",  
          "offset": 227,  
          "length": 10,  
          "confidenceScore": 0.8  
        }, {  
          "text": "30087",  
          "category": "Quantity",  
          "subcategory": "Number",  
          "offset": 260,  
          "length": 5,  
      
      "modelVersion": "2      "confidenceScore": 0.8  
        }],  
        "warnings": []  
      }],  
      "errors": [],