Named Entity Recognition: Basic Concepts to Practical Uses

Written by Alyssa Towns | Sep 11, 2024 4:56:26 AM

There’s a good chance you process information so quickly in conversation that your brain naturally categorizes it without you being aware. 

Suppose you hear the sentence, “I recently picked up a new pink plant pot, and Hoya plant from The Plant Room, my favorite nursery nearby,” your brain effortlessly connects:

  • Pink = color 
  • Hoya plant = item or type of plant
  • The Plant Room = name of the store 

Named entity recognition models work the same way. 

Artificial neural networks (ANNs) are models that adapt to new information and learn to make decisions based on it. Various industries, including healthcare, financial services, automotive, and technology, use ANN software to complete tasks such as predictive analytics, anomaly detection, and image and voice recognition. 

Deep neural networks (DNN), a subset of artificial neural networks, are essential for building deep learning functions like NER. 

Named entity recognition: step-by-step

Named entity recognition takes unstructured text and enables machines to extract valuable categories of information from it. Its primary goal is to identify and classify named entities from the data sets into predefined categories. Below are the high-level steps that occur during the NER process.

Prepare an annotated dataset

To train NER models, you first need to provide it with an example dataset containing sentences that include the entities you want to recognize. The model must learn to identify these identities by being shown what to look for.

You could train a model to recognize:

  • Organization names
  • Names of people
  • Locations
  • Dates (with a specified date format) 
  • Monetary values 
  • Job titles

To do this, you’d prepare a dataset with sentences that include the specific entities and the appropriate labels for those entities. In our demonstration below, we’’ focus on training the NER model to recognize names of people, organization names, and dates in the YYYY format.

This training process will prepare the model to recognize entities going forward successfully.

Tokenization and preprocessing

Once trained, we can provide unstructured text for preprocessing. Before identifying entities in the data, it breaks down the text into tokens or segments consisting of words, phrases, or even whole sentences. This tokenization enables the machine to separate information, preparing it for identification and analysis. 

For instance, the sentence, “Godard Abel is the CEO of G2, a company he co-founded in 2012,” would be broken down into tokens such as:

  • Godard 
  • Abel
  • CEO 
  • G2
  • company
  • co-founded 
  • 2022

Entity identification and classification

The machine uses rules and statistical methods to detect named entities during early identification. It observes the text in search of patterns and specific textual formats. Using parts of speech (POS) tagging, the model can analyze words based on their context and definition. This helps analyze homonyms correctly in context. 

“Date” can be a noun or a verb, and the word's context varies depending on the context.

  • What is today’s date (noun)? 
  • Do you want to go on a date (noun) with me? 
  • The company dates (verb) back to the early 90s. 

The model categorizes these entities based on tokens, POS tagging, and its trained knowledge of the entities you want to capture. During the final refinement phase, it might resolve ambiguities, merge multi-token entities, and address any other data nuances before labeling them. 

In our example, our trained mode would label our sentence as such:

Godard Abel (name of person) is the CEO of G2 (organization name), a company he co-founded in 2012 (date). 

Model training and testing

After training the model, continue to feed it unstructured data to test and update the model to ensure it meets your needs.

Named entity recognition methods

The type of NER method that will fit your needs depends on your dataset and desired outcomes. There are three broad categories of NER methods, with an additional fourth allowing organizations to combine elements of the first three. 

Dictionary-based

The dictionary-based method involves training NER models to reference terms within dictionaries, identify them in text, and classify them into predetermined categories. You can use well-known dictionaries or create one with a collection of words related to your specific domain. 

For example, in the digital marketing industry, a dictionary might include industry-wide acronyms, such as SEO (search engine optimization), CPC (cost per click), and KPI (key performance indicators). 

Rule-based

A rule-based approach requires creating a set of instructions to guide the model in identifying entities based on grammar, structure, and other word features. There are two types of rule-based instructions:

  • Pattern-based rules relate specifically to word forms and structures. For example, a pattern-based rule might state, “A sequence of capitalized words followed by “Inc.” refers to a business name.” 
  • Context-based rules provide instructions based on the data in context. An example of a context-based rule is, “If a word precedes a state abbreviation followed by a comma, it is the state’s capital.” 

Machine learning-based

More complex than dictionary and rule-based methods, machine learning-based NER methods use statistical modeling and algorithms to identify entity names. To use a machine learning-based model, a user must train the NER system using annotated documents and labeled training data. While proper training ensures the model is equipped to deliver the best results, these models can also be expensive and time-consuming to set up initially. 

Hybrid

Finally, a hybrid approach allows model users to mix and match the above learning methods to leverage their strengths. For example, users might combine a rule-based method with machine learning to identify complex and specific entities tailored to their unique needs.

Challenges in named entity recognition

While NER technologies are renowned for quickly analyzing and labeling vast amounts of unstructured data, businesses should be aware of the potential challenges. 

Multiple meanings and ambiguity

Homonyms pose analysis issues for NER models without proper training and context. For example, the word “orange” could refer to the color or the fruit. Without enough contextual information, NER models may struggle to identify and classify ambiguous terms. What’s more, words with multiple variations, such as “barbecue,” “barbeque,” and “BBQ,” can add additional complexity, leading to misclassification or oversight. 

Lack of training data

NER models heavily rely on a substantial amount of annotated data to understand how to recognize and categorize entities. Gathering annotated data can be time-consuming and, in some instances, complicated, as users might not have enough data to train the model on. Improper training can lead to poor quality results. 

Unfamiliar terms and phrases

NER models work off what they know, meaning uncommon terms and unfamiliar words can pose challenges. If a NER model doesn’t recognize a word, it may fail to identify and classify it into the proper entity category. 

Use cases for named entity recognition

Many industries and sectors leverage named entity recognition models to extract and utilize business data quickly. Below are some of the everyday use cases across various applications today. 

Customer service

Thanks to chatbot technology and online user access, customer support is now available round the clock. NER powers chatbots by identifying entities within user submissions to determine their question or comment context. With this information, the chatbot can direct users to relevant resources or connect them with a live support specialist. Without effective NER, the information chatbots may be less relevant or helpful in solving their challenges. 

Finance

Financial professionals use NER models to classify information on financial forms, automate assessment and approval processes, and gain insights from customer data. For example, home loan paperwork is extensive, often with hundreds of pages of explanations and details. While the details are essential, a NER model could quickly extract the most critical data to give borrowers a one-page overview of the highlights.

DataInFormation trained a NER model on U.S. Securities and Exchange Commission (SEC) merger forms excerpts. The model tagged method types, discount ranges, providers, recipients, and discount rate types. They noted that the model achieved 92.4% accuracy in its entity recognition. 

Healthcare

Patient medical records are critical to healthcare practices, but reading through pages of documents to find what you need can feel daunting. NER allows healthcare professionals to extract crucial information from records without losing time. This is handy when obtaining a high-level overview of a patient’s medical history, including past medications and diagnoses. 

An in-depth decade-long study traced the evolution of NER in electronic health records (EHRs), highlighting a shift from rule-based to deep-learning models to boost effectiveness. 

Resume parsing

Screening resumes, especially without the help of an applicant tracking system (ATS), is one of the most time-consuming tasks for recruiters and hiring managers. Rather than go through resumes one by one, NER models can extract specific entities, such as educational requirements, skills, certifications, and accomplishments, for a quicker review. One model reported in a study proposed a system for summarizing resume content using NER and ranking documents for final review by a human recruiter. 

Education

For academics, an adequately trained NER model could quickly summarize volumes of material or extensive textbooks to extract information about specific topics. This could help identify themes or connections across resources without having to work through the reading material oneself. Ultimately, NER models can enhance the research process to allow more time for other critical thinking tasks, such as writing and analyzing the material. 

Spot the entity

Named entity recognition is an information extraction task that identifies and categorizes unstructured data into predefined categories (or named entities). You can train a model with sufficient labeled training data to recognize the entities you want to pull from your data. Remember that the NER model will only be as effective as you prepare it to be. 

Read more about how artificial neural networks (ANN) learn from us.