# Company name matching

**URL:** <https://support.prodi.gy/t/company-name-matching/2661>\
**Category:** Uncategorized\
**Tags:** usage, ner\
**Created:** [March 15, 2020, 6:21am UTC](https://support.prodi.gy/t/company-name-matching/2661 "2020-03-15T06:21:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![boxabirds](https://avatars.discourse-cdn.com/v4/letter/b/c57346/32.png) [@boxabirds](https://support.prodi.gy/u/boxabirds)\
**Post date:** [March 15, 2020, 6:21am UTC](https://support.prodi.gy/t/company-name-matching/2661/1 "2020-03-15T06:21:52Z")

</div>

Hi all I'm a Prodigy n00b and proud owner and supporter of Prodigy, with a little background into NLP.

My first business problem is company name matching. Let's assume we have 100,000 companies from two separate datasets, from different industries, so canonicalisation is unlikely to work.

Is Prodigy the tool for this? Or should I look at other methods. The concern I have is that through the lens of entity matching this would require a very large number of classes (one per company) and that may not be practical.

Guidance most appreciated!

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [March 16, 2020, 11:12am UTC](https://support.prodi.gy/t/company-name-matching/2661/2 "2020-03-16T11:12:24Z")

</div>

Hi! So just to make sure I understand the use case correctly: Do you already have labelled examples or word lists for the comany names you're looking for, or do you also need to find and detect what's a company name, and then resolve them to a distinct ID? For instance, detect that both `apple` and `Apple, Inc` in certain contexts are both mentions of the company Apple, Inc.?

It sounds like you have several problems to solve here that might make sense to tackle as separate machine learning tasks:

1. **Finding all company names.** This is a more generic named entity recognition task and you can probably take advantage of existing pretrained models or match patterns to help you with the annotation. Workflows you can use in Prodigy are `ner.manaul` (with `--patterns` to pre-highlight terms from a list for you), or `ner.correct` with a pretrained model that highlights `ORG` entities for you so you only need to correct it. At the end of it, you can train a model that should hopefully be able to find you all mentions of company names with decent accuracy.
2. **Named entity disambiguation and or entity linking.** Given a company name, you want to know the instance of the real-world object it maps to – for instance, an ID in your knowledge base. As you already noted in your post, solving this as a sequence tagging problem with one label per company isn't feasible. You typically want to predict IDs for given entity spans predicted by your entity recognizer. You can also create training data for this in Prodigy, by going over the `ORG` entities predicted by the model and selecting the correct knowledge base entry from a set of candiates.

You can find more details here about spaCy's support for entity linking here: [https://spacy.io/usage/training#entity-linker](https://spacy.io/usage/training#entity-linker) Also check out this great talk by @SofieVL if you haven't seen it:

https://www.youtube.com/embed/PW3RJM8tDGo?feature=oembed&wmode=opaque&list=PLBmcuObd5An4UC6jvK_-eSl6jCvP1gwXc

If this is relevant to you and you get to that step (creating your own training data for entity linking with Prodigy), Sofie might also be able to share some Prodigy recipes and tips with you 😊
