Name entity recognition in the insurance industry: a case study
Companies from a wide variety of domains like insurance, real estate, or medical institutions are concerned with the complexity of retrieving specific information from documents. This has become a major problem in recent years with the digitalization of documents and the enormous amount of data exchanged between businesses.
The recent developments in the field of artificial intelligence (AI) allow companies like independent corporate venture builder Creative Dock to tackle this problem, using Name Entity Recognition (NER). Let’s explain how we developed a customized solution for our clients, reaching a 97% accuracy rate in retrieving data from their documents using AI.
How NER simplified the life of actuaries at HGS
Not sure what a thing like Name Entity Recognition could be used for? Let’s start with a practical example from Creative Dock’s own experience.
In addition to comprehensive corporate venture building, we provide our clients with several AI-based SaaS solutions. This is just what we did for HGS — one of the largest insurance houses for the shipping industry. Because of the thousands of variables, huge insurance values, and lots of hard-to-calculate factors from weather to geopolitics that can affect shipping, this is one of the most difficult insurance industries to underwrite.
Why NER is a heaven-sent solution for maritime insurance
A large part of international trade has depended on maritime transport since the beginning of time. HGS has been providing insurance to many shipping companies for decades. But analyzing large amounts of critical data is extremely complex: it can only be handled by a few experts in the world, so not only does it take a lot of time, but it’s also expensive.
In 2020, HGS turned to Creative Dock not for building a new venture, but “just” for a new innovative digital solution. It needed to make the process faster and more efficient — the better the insurance, the bigger the business.
In the year 2021 alone, the statistics recorded over 9,000 marine insurance claims. It doesn’t seem like much, but the total amount of damages exceeded 14.3 billion dollars. Moreover, the global fleet is aging, with the average age of merchant ships being 21.75 years. So insurance calculations are becoming increasingly difficult.
That’s why we came up with POSEIDON, an AI-based application that can read and sort complex information, combining object detection, computer vision, and natural language processing.
By analyzing all the data collected by the International Maritime Organization on a particular ship, the application can determine a very accurate insurance price in a flash, based on the extracted information.
“One of the algorithms developed in Poseidon can extract specific information from texts, like plan types, insured companies, and more… This feature is based on Name Entity Recognition and has an accuracy of 97% accuracy over thousands of documents!”
What is Name Entity Recognition?
NER is a branch of Natural Language Processing (NLP) that involves recognizing specific patterns in text. By labeling these patterns, it becomes possible to retrieve information from documents, like addresses, phone numbers, society’s names or even dates.
With the latest development of Machine Learning, the efficiency of extracting entities from text has increased over time to reach amazing results!
A brief history of Name Entity Recognition
Extracting entities from text evolved drastically throughout the years, from writing all patterns manually, to training machines to have an overall comprehension of languages.
Let’s shortly move through history to understand how NER evolved over time:
Rules-based method is the most intuitive technique to retrieve data from text. It consists of“telling” the machine exactly what it has to look for, based on a set of rules!
Let’s say you want to code a program capable of finding Waldo in a large crowd. Imagine you could also talk directly to the machine (which is possible today with ChatGPT). Using a rules-based method would mean that you would say:
“Find a guy who wears round glasses, a cap, and a sweater with white and red stripes, has brown hair, is smiling,…”
And the machine will extract all individuals matching the description you provided!
Extracting entities from text works in a similar manner. By implementing every way an expression could be written in documents, the algorithm will be able to parse each of them.
However, it is possible that the entities one would like to extract could be written in so many different ways that it would be difficult to write them all. We can think of company names, for instance, which can change over time (modification of the name, new companies, etc.)
Therefore, to prevent this from happening, the rules-based method was often (and still is) used with linguistic science.
Before the use of Machine Learning models exploded in recent years, NLP data scientists were called linguistic scientists. By understanding how a language is structured, they were able to retrieve values from it.
Coupled with rules-based methods, one can extract entities by the grammatical structure they are composed of. In the above example, a person’s name can be retrieved by looking for all patterns constituted of 2 Proper Nouns (here Pierre Vinken as NNP-NNP).
However, this technique comes with a major drawback: what if the entity is written in a way you have never encountered before (Pierre Edouard Vinken)? Or what if there is a typo? The algorithm will not be able to parse these entities correctly.
This is where Machine Learning algorithms come in!
If we take the example of Waldo, in contrast with rules-based methods, using Machine Learning consists of training the algorithm to recognize Waldo without any rule!
“All these guys are Waldo. Look at them, find your own patterns, and then find him by yourself!”
By showing portions of text representing an entity you want to parse, the algorithm will create its own “rules” based on its training and return the entities with the highest probability.
But Machine Learning doesn’t understand the text. Only numbers. So how does it learn?
Sentences are actually tokenized (split into single words), then transformed into a list of numbers (a vector). Each vector can be seen as a token’s fingerprint: it is unique, and has its own signification.
In the last few years, scientists found a way to code each token based on its surroundings (called word context): word2vec (2013), GloVe (2014), or Fasttext (2016). Thanks to these innovations, entities are no longer retrieved based on how they are written, but on how they are used in the entire context.
This “human perception” of texts applied to the machine reached another summit in 2017 with the concept of Attention, from the paper Attention is all you need. This innovation led to the creation of Transformers, a deep learning architecture, also used in Language models trained on a massive amount of texts from the internet that drew a deep understanding of human languages.
As you have read, Name Entity Recognition evolved over time to achieve amazing results throughout business cases.
Now that we have introduced its history and fundamentals, let’s talk about a business case Creative Dock has tackled for a client, using NER.
And now: how to use NER for a successful business case
Our client is a marine insurance company that receives a significant amount of documents and contracts from third parties. From there, they would like to automatically parse all relevant information and exploit this retrieved data to fluidify their business through an application.
1. Understanding the issue
All projects start by asking questions about the result the client wants to achieve.
“How will solving this issue help your business?”
“What do you expect from this application?''
This phase is mandatory to estimate the time and resources required to reach the objectives. It will depend on many factors and varies significantly between businesses.
Even though we introduced many different algorithms in this article, using the right ones is crucial when it comes to the final architecture. For example, Language Models perform really well today but are relatively heavy and consume a lot of resources; they should only be used if the problem cannot be solved with a less resource-consuming model.
2. Creating the architecture
Our client is interested in building an application that parses all data from documents in diverse formats: dates, company names, amounts in different currencies, etc.
Therefore, our objective is to create a model architecture able to reach a high Precision level: for every parsed document, the correct value must be returned.
To improve the overall precision of our application, we build an architecture that processes the text in two ways:
- A rules-based method, using Regular Expressions
- An NER machine learning algorithm using the Python library Spacy
When the architecture is defined, it is time to train our Machine Learning model!
3. Training the machine learning model
Training a machine learning model consists in “feeding” it with labeled data. This way it discerns patterns in the text by itself and returns the correct entities.
With a set of documents sent by our client, we manually label each entity using Doccano, an online labeling tool.
We then train the NER model on this labeled dataset using Spacy, a python library dedicated to NLP. After the training is complete, we evaluate our model on a testing set and then directly in production.
The architecture deployed in the application returns amazing results: 97% accuracy over all documents. It is able to parse the majority of the various labels our client needs for the business: plan type, contract period, etc. Our developed architecture works like a charm!
In this article we introduced the Name Entity Recognition algorithm, a branch of Natural Language Processing. We briefly went through its evolution over time and presented different techniques to achieve the desired results: retrieving data from texts.
We described our business case as well as the methods we used to achieve 97% accuracy. Our client is currently using the application cited in this article and it has already brought a lot of value to the business.
Don’t hesitate to ask Creative Dock’s Big Data team questions, and check out our website.