# Spanish NER by context

**URL:** <https://support.prodi.gy/t/spanish-ner-by-context/1150>\
**Category:** Uncategorized\
**Tags:** usage, ner, spacy, solved\
**Created:** [January 23, 2019, 2:45pm UTC](https://support.prodi.gy/t/spanish-ner-by-context/1150 "2019-01-23T14:45:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaquin](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@joaquin](https://support.prodi.gy/u/joaquin)\
**Post date:** [January 23, 2019, 2:45pm UTC](https://support.prodi.gy/t/spanish-ner-by-context/1150/1 "2019-01-23T14:45:41Z")

</div>

Hi, I need help classifying entities on contracts in spanish. I’ve classified them and also obtained the type of clauses, and entities. But I need to extract the context and it’s been hard. Can prodigy help me with this? how many I need to manually tag, if I have some regex that are currently working, at least for the entities. Is this tool good enough to get the context on spanish contracts?

Please let me know or contact me by email

---

<div class="post-metadata">

**Author:** ![joaquin](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@joaquin](https://support.prodi.gy/u/joaquin)\
**Post date:** [January 23, 2019, 5:49pm UTC](https://support.prodi.gy/t/spanish-ner-by-context/1150/2 "2019-01-23T17:49:45Z")

</div>

> [@joaquin](#):
>
> gy help me with this? how many I need to manually tag, if I have some regex that are currently working, at least for the entities. Is this tool good enough to get the context on spanish contracts?
> 
> Please let me know or contact me by email

Regarding my question, is prodigy good to extract the context of the entity? who is the owner? what is that date and this other? etc

---

<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:** [January 23, 2019, 7:00pm UTC](https://support.prodi.gy/t/spanish-ner-by-context/1150/3 "2019-01-23T19:00:31Z")

</div>

Prodigy is an annotation tool that lets you create training data for machine learning models. Whether the models will learn what you want them to learn, and whether your problem can be solved depends on how you decide to break down your problem, the data you're labelling and how you're training the model.

Prodigy can help you label data more efficiently, and if you want to use [spaCy](https://spacy.io) (which Prodigy integrates with out-of-the-box), it can also help you run training experiments faster. But legal NLP isn't trivial and you'll likely have to run a lot of experiments and try out different things until you end up with a system that works for you. It's also totally possible that after your experiments, you'll find out that a machine learning system currently isn't able to beat your regular expressions 😉

If you have a set of regular expressions that's working well, you can use those to bootstrap training data and create suggestions. So instead of labelling everything by hand, you'll only need to correct what your rules got wrong.

You also want to keep an eye on the _local context_ around the entities you're interested in – especially the surrounding tokens on each side. Those will be most relevant to make the decision. If the local context doesn't have enough clues, the model may struggle to learn the distinctions. For cases like this, a mix of rules and a statistical model might be a better fit. This thread has more details and examples:

> [@Fact extraction for earnings news](https://support.prodi.gy/t/fact-extraction-for-earnings-news/1023):
>
> Hello everyone, I am new to the community but I really think SpaCy and prodigy looks promising for the challenge I am facing. I will outline my project and then list some questions to that. I want to be able to extract facts from an earnings report like [example one](https://newsclient.omxgroup.com/cdsPublic/viewDisclosure.action?disclosureId=848555&lang=en) and [example two](https://newsclient.omxgroup.com/cdsPublic/viewDisclosure.action?disclosureId=849366&lang=en). From those two examples I want to extract something sales. I.e. Example one: Electrolux Q2 Sales 31,354m SEK Example two: Metso Q2 Sales 786m EUR Note in the second example sales are given for both first half ye…

You might also find @honnibal's talk on structuring NLP projects helpful, which also shows some examples of spaCy and Prodigy:

https://www.youtube.com/embed/jpWqz85F_4Y?feature=oembed&wmode=opaque&list=PLBmcuObd5An7oE73XacDNJ3ZxO82ogc6j

---

<div class="post-metadata">

**Author:** ![joaquin](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@joaquin](https://support.prodi.gy/u/joaquin)\
**Post date:** [January 24, 2019, 1:18pm UTC](https://support.prodi.gy/t/spanish-ner-by-context/1150/4 "2019-01-24T13:18:08Z")

</div>

Thanks Ines!,

So does Prodigy and Spacy can help me with getting context from the near tokens or just the annotation part?

Regards,  
Joaquin

---

<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:** [January 24, 2019, 1:24pm UTC](https://support.prodi.gy/t/spanish-ner-by-context/1150/5 "2019-01-24T13:24:28Z")

</div>

spaCy is an open-source library for Natural Language Processing that can help you train your own models for named entity recognition. Named entity recognition models can predict "real-world objects" like persons or organisations, based on the surrounding context. See here for details:

> **[spaCy 101: Everything you need to know · spaCy Usage Documentation](https://spacy.io/usage/spacy-101/)**
>
> The most important concepts, explained in simple terms

Prodigy is an annotation tool that can help you create training data for those models. See here for details:

> **[Named Entity Recognition · Prodigy · An annotation tool for AI, Machine...](https://prodi.gy/features/named-entity-recognition/)**
>
> Tagging names, concepts or key phrases is a crucial task for Natural Language Understanding pipelines. The Prodigy annotation tool lets you label NER training data or improve an existing model's accuracy with ease.

---

<div class="post-metadata">

**Author:** ![joaquin](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@joaquin](https://support.prodi.gy/u/joaquin)\
**Post date:** [January 24, 2019, 1:58pm UTC](https://support.prodi.gy/t/spanish-ner-by-context/1150/6 "2019-01-24T13:58:20Z")

</div>

Ines, is there a way I can test a demo with spanish? I’ll like to try that before. I didn’t found a way to try that on the live demo

---

<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:** [January 24, 2019, 2:01pm UTC](https://support.prodi.gy/t/spanish-ner-by-context/1150/7 "2019-01-24T14:01:14Z")

</div>

Yes, the live demo only really shows the UI. The back-end is a bit harder to demo online, as it’s a command-line app and Python library.

We normally do trials by hosting a VM for you that you can log into. This lets you get the full experience of the tool, including the scriptable back-end. You can email us at contact@explosion.ai

---

<div class="post-metadata">

**Author:** ![joaquin](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@joaquin](https://support.prodi.gy/u/joaquin)\
**Post date:** [January 24, 2019, 2:02pm UTC](https://support.prodi.gy/t/spanish-ner-by-context/1150/8 "2019-01-24T14:02:18Z")

</div>

> [@ines](#):
>
> contact@explosion.ai

Thanks! I really need this to boost my clasification of the data
