Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Publication

Neural Entity Linking in JPMorgan Chase
Latest

Neural Entity Linking in JPMorgan Chase

Last Updated on August 2, 2022 by Editorial Team

Author(s): Harshit Sharma

Originally published on Towards AI the World’s Leading AI and Technology News and Media Company. If you are building an AI-related product or service, we invite you to consider becoming an AI sponsor. At Towards AI, we help scale AI and technology startups. Let us help you unleash your technology to the masses.

Neural Entity Linking at JPMorganΒ Chase

JPMC published a paper in 2021 highlighting their approach to Entity Linking. This article summarizes the problem statement, solution, and other key technical components of theΒ paper

What is EntityΒ Linking?

It's the task of assigning a unique identity to ambiguous mentions of named entities in aΒ text.

An example of an entity linking from Wikipedia

Here, β€œParis” from the text is given a unique identity via a URL (the most common type of URI) β€œwikipedia.org/wiki/Paris”. Note that the type of URI used to identify the mentioned entity depends on the domain uniquely. For eg, Instead of a web address, we could have used ISBNs if we were to identify books from aΒ text.

JPMC was interested inΒ :

Mapping mentions of financial institutions from news articles to the entities stored in their internal knowledge base (stored as a Knowledge Graph)

An example is shownΒ below:

Example of Entity Linking from theΒ paper

There are two sub-problems that must beΒ defined:

  1. Recognition:
    Extraction of mentions from financial news articles. JPMC has used Spacy forΒ this.
  2. Linking:
    Choosing the correct entity from the internal Knowledge Graph to be linked to the extracted mentions in the previous step. The paper discusses thisΒ step.

A pictorial representation of this is shownΒ below:

(Image by Author) Sub-problems as part of the overallΒ solution
  1. String Matching
    These approaches capture the β€œmorphological” structure of the entity names. The team experimented with
    (a) Jaccard
    (b) Levenshtein
    (c) Ratcliff-Obershelp (also known as Gestalt-Pattern-Matching)
    (d) Jaro Winkler
    (e) N-Gram Cosine Similarity

The con of these approaches is that they focus just on the β€œsyntactics” of the names and not the semantics. An example of a failure case would be the matching of β€œLumier” and β€œLumier”. Even though they are exactly the same, they refer to two different entities.

2. Context Similarity Methods
These methods take the contexts around mentions and entities to give a similarity score.
The Context for β€œmention” is text to the left and right of the mention, whereas
the Context for β€œentity” is all the data that's stored in the KG for this entity.
Finally, Cosine similarity / Jaccard similarity can be used on top of the contextΒ vectors.

3. ML Classification
Naive Bayes, Logistic Regression, and SVM are trained on (mention, entity) pairs to find the ones that should beΒ linked

4. Learn to Rank Methods (LTR)
These models work in tandem with ML approaches, which might give us multiple (mention, entity) pairs as the solutions. LTR approaches just narrow down to the most probable solution.

The idea is to capture both Semantic distance(the meaning that the mention or entity stands for) and Syntactic distance (character composition of the name) between the names and use a contrastive loss function to train aΒ model.

We will see below how both of these distances are calculated step byΒ step.

Step 1: Obtain embeddings for Entities andΒ Mentions

To come up with both of the distances, the authors have proposed to use embeddings for mentions as well as entities in theΒ KG.

To obtain Entity embeddings, the authors have used a Triplet Loss function (shownΒ below)

Triplet LossΒ Function

For each entity, they used 10 positive and 10 negative samples, making 10 <entity, positive word, negative word> triplets.

Model for Entity embedding

Unlike Entity embeddings, which they had precomputed, the mention embeddings were trained using the on-the-go embeddings approach, where the embedding matrix is learned during the trainingΒ itself.

Step 2: Calculate Syntactic DistanceΒ score

Before going further, it's worth mentioning β€œWide & Deep” architecture which was introduced by Google in 2016. You can find their official blog here. We won’t go into the details, but to give a summary, it's an architecture that has two componentsβ€Šβ€”β€ŠThe Wide component and the Deep component.

Image from Google’s paper | Spectrum of Wide and DeepΒ Models

Syntactic Distance score calculation is done using the WIDE part, which consists of a Linear SiameseΒ Network.

Calculation of Syntax DistanceΒ score

The output of the siamese network is the vectors for both the entity and the mention, which are then compared to find the Euclidean distance.

Step 3: Calculate Semantic DistanceΒ score

Semantic Distance score calculation is done using the DEEPΒ part

Calculation of Semantic DistanceΒ score

eβ‚– is the pre-trained embedding for the β€œApache Corp” that was calculated in Step 1. To obtain the embedding for the mention, its left and right context words are fed into a Bi-LSTM network that trains the embeddings. The embedding vectors of mention (Vβ‚˜) and the entity (Vβ‚‘) are then used to find the Euclidean distance:

Step 4: Compute Contrastive Loss

Both Syntactic and Semantic distances are combined in a weighted fashion asΒ follows:

The contrastive loss function is then combined asΒ follows:

Contrastive LossΒ Function

where Y is the ground truth value, where a value of 1 indicates that mention m and entity e are matched, 0 otherwise.

Combining all the pieces, the final model framework is shownΒ below:

JEL Model Framework

At the time of writing this paper, JPMC was still in the process of deploying the model, which, once done, will help support users across JPMC in discovering relevant and curated news that matters to their business.

From the cost perspective, not all the mentions are fed through the JEL framework as that would be computationally expensive. JPMC has put another blocking layer to funnel out the mentions that share less than 2 bigrams with the entities from their internalΒ KGs.

Once again, here is the paper link if you would like to read the fullΒ paper.

Follow Intuitive Shorts (my Substack newsletter), to read quick and intuitive summaries of ML/NLP/DS concepts.


Neural Entity Linking in JPMorgan Chase was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.

Join thousands of data leaders on the AI newsletter. It’s free, we don’t spam, and we never share your email address. Keep up to date with the latest work in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming aΒ sponsor.

Published via Towards AI

Feedback ↓