Named Entity Recognition: Concept, Tools and Tutorial

Named Entity Recognition: Concept, Tools and Tutorial

Named entity recognition (NER) ‒ also called entity identification or entity extraction ‒ is a natural language processing (NLP) technique that automatically identifies named entities in a text and classifies them into predefined categories. Entities can be names of people, organizations, locations, times, quantities, monetary values, percentages, and more.

An example of how named entity extraction NER works. The entities WeWork, Adam Neumann, Manhattan, and $37.5 million, have been highlighted

With named entity recognition, you can extract key information to understand what a text is about, or merely use it to collect important information to store in a database.


Automatically extract key data from text


In this guide, we’ll explore how named entity recognition works, its applications in business, and how to perform entity extraction using no-code tools like MonkeyLearn.

  1. How Does Named Entity Recognition Work?
  2. What Is Named Entity Recognition (NER) Used For?
  3. How to Perform Named Entity Recognition

How Does Named Entity Recognition Work?

When we read a text, we naturally recognize named entities like people, values, locations, and so on. For example, in the sentence “Mark Zuckerberg is one of the founders of Facebook, a company from the United States” we can identify three types of entities:

  • “Person”: Mark Zuckerberg
  • “Company”: Facebook
  • “Location”: United States

For computers, however, we need to help them recognize entities first so that they can categorize them.

This is done through machine learning and Natural Language Processing (NLP).

NLP studies the structure and rules of language and creates intelligent systems capable of deriving meaning from text and speech, while machine learning helps machines learn and improve over time.

To learn what an entity is, an NER model needs to be able to detect a word, or string of words that form an entity (e.g. New York City), and know which entity category it belongs to.

So first, we need to create entity categories, like Name, Location, Event, Organization, etc., and feed an NER model relevant training data. Then, by tagging some word and phrase samples with their corresponding entities, you’ll eventually teach your NER model how to detect entities itself.  

Try out our pre-trained named entity extractor, to see how it works:

Test with your own text

Results

TagValue
PERSONElon Musk

What Is Named Entity Recognition (NER) Used For?

Named entity recognition (NER) helps you easily identify the key elements in a text, like names of people, places, brands, monetary values, and more. Extracting the main entities in a text helps sort unstructured data and detect important information, which is crucial if you have to deal with large datasets.

Here are some interesting use cases of named entity recognition:

Categorize Tickets in Customer Support

If you’re dealing with a rising number of customer support tickets, you can use named entity recognition techniques to handle customer requests faster.

Automate repetitive customer service tasks, like categorizing customers’ issues and queries, and save you valuable time that will help improve your resolution rates and boost customer satisfaction.

You can also use entity extraction to pull relevant pieces of data, like product names or serial numbers, making it easier to route tickets to the most suitable agent or team for handling that issue. 

Gain Insights from Customer Feedback

Online reviews are a great source of customer feedback: they can provide rich insights about what clients like and dislike about your products, and the aspects of your business that need improving.

NER systems can be used to organize all this customer feedback and pinpoint recurring problems. For example, you could use NER to detect locations that are mentioned most often in negative customer feedback, which might lead you to focus on a particular office branch.

Content Recommendation

Many modern applications (like Netflix and YouTube) rely on recommendation systems to create optimal customer experiences. A lot of these systems rely on named entity recognition, which is able to make suggestions based on user search history.

For example, if you watch a lot of comedies on Netflix, you’ll get more recommendations that have been classified as the entity Comedy.

Process Resumes

Recruiters spend many hours of their day going through resumes, looking for the right candidate. Each resume contains the same type of information, but they’re often organized and formatted differently: a classic example of unstructured data. 

By using an entity extractor, recruitment teams can instantly extract the most relevant information about candidates, from personal information (like name, address, phone number, date of birth and email), to data related to their training and experience (such as certifications, degree, company names, skills, etc).

How to Do Named Entity Recognition

The easiest way to get started with named entity recognition is using an API. Basically, you can choose between two types:

Open-Source named entity recognition APIs

Open-source APIs are for developers: they are free, flexible, and entail a gentle learning curve. Here are a few options:

  • Stanford Named Entity Recognizer (SNER): this JAVA tool developed by Stanford University is considered the standard library for entity extraction. It’s based on Conditional Random Fields (CRF) and provides pre-trained models for extracting person, organization, location, and other entities. 
  • SpaCy: a Python framework known for being fast and very easy to use. It has an excellent statistical system that you can use to build customized NER extractors.
  • Natural Language Toolkit (NLTK): this suite of libraries for Python is widely used for NLP tasks. NLKT has its own classifier to recognize named entities called ne_chunk, but also provides a wrapper to use the Stanford NER tagger in Python.

SaaS named entity recognition APIs

SaaS tools are ready-to-use, low-code, and cost-effective solutions. Plus, they are easy to integrate with other popular platforms.

MonkeyLearn, for example, is a text analysis SaaS platform that you can use for different NLP tasks, one of which is named entity recognition. You can use MonkeyLearn's ready-built API to integrate pre-trained entity extraction models, or you can easily build your own custom named entity extractor in just a few simple steps. 

Let’s take a look at each option: 

MonkeyLearn’s Pre-Trained Models for Entity Extraction 

If you want to get started right away, pre-trained models are your best option. At MonkeyLearn you’ll find several models for entity extraction which can automatically extract and classify persons, locations, and organizations in text:

Test with your own text

Results

TagValue
PERSONElon Musk

You can also upload text in an Excel or CSV file, or connect your data source using MonkeyLearn’s API and integrations, like Zapier, Google Sheets, or Rapid Miner.

How to Build a Custom Entity Extractor with MonkeyLearn

If you want to get the most out of entity extraction, you’ll need to build your own extractor. This way you can train your model with relevant examples, and sort text with your own predefined categories and criteria. 

Creating a custom NER model with MonkeyLearn is really simple, you just need to follow these steps:

  • Create a new model.

Sign up to MonkeyLearn for free, click on Create Model and choose “Extractor”.

MonkeyLearn's model builder with the option to choose to build an extractor or classifier
  • Import your data. You can upload a CSV or excel file, connect to an app, or use one of our sample data sets. 
MonkeyLearn's model builder with the option to import your training data as an Excel file, CSV file, or using example training data from the data library
  • Select the column with the data you’d like to use to train your model.
MonkeyLearn's model builder whowing the data that has been pulled in
  • Define the tags for your model. These are the categories you will use for your entity extractor. Write at least one, you can add more later.
MonkeyLearn's model builder showing how to define tags: enter tag name then click the plus icon to add a new tag. Then click continue once you've added all tags
  • Start training your model. Manually tag the words by choosing a tag from the right and clicking on the word that matches that tag. You’ll need to tag several examples to train your model. After a while, the model will start making its own predictions.
Example of how a named entity extractor is trained. The tags Brand, Model, and Storage are used to highlight relevant text
  • Put your model to work. Now that you’ve trained your entity extractor, you can start analyzing your data. There are several ways to do this: upload a file for batch processing, connect to the API, or try one of our available integrations.
Example of how a named entity extractor is tested.

Start Using Named Entity Recognition

Companies can use Named entity recognition (NER) to label relevant data in customer support tickets, detect entities mentioned in customer feedback, and easily extract important information, like contact information, location, dates, among other things.

Using entity extraction APIs (whether it’s through open-source libraries or SaaS tools) is the most popular way to get started with named entity recognition. Deciding on the best option, however, will depend on your skillset, time, and resources.

With MonkeyLearn’s low code, no code approach, you can perform entity extraction quickly and easily right away.

Ready to see how it works? Schedule a demo with MonkeyLearn.

Inés Roldós

March 30th, 2020

Posts you might like...

MonkeyLearn Logo

Text Analysis with Machine Learning

Turn tweets, emails, documents, webpages and more into actionable data. Automate business processes and save hours of manual data processing.

Try MonkeyLearn
Clearbit LogoSegment LogoPubnub LogoProtagonist Logo