简体   繁体   中英

SpaCy NER differentiating numbers or entities

I am currently playing with SpaCy NER and wondering if SpaCy NER can do these 2 things:

Case 1

Let's say we have 2 sentences that we want to do NER with:

  1. Sugar level in his body is increasing.
  2. His overall health quality is increasing.

Can we tag "increasing" in the first sentence as "symptoms" entity, and tag "increasing" in the second one as "good outcome" entity? Will NER see the difference in those 2 "increasing" words?

Case 2

We also have 2 different sentences:

  1. My salary is USD 8000 per month
  2. My spending is USD 5000 per month

Can NER see the number in the first sentence as "income" entity and the number in the second sentence as "spending"?

Thank you

These tasks go beyond what you would expect an NER model to be able to do in a number of ways. Spacy's NER algorithm could be used to find types of entities like MONEY (which is an entity type in its English models) or maybe something like SYMPTOM , but it doesn't look at a very large context to detect/classify entities, so it's not going to be able to differentiate these cases where the relevant context is fairly far away.

You probably want to combine NER (or another type of relevant span detection, which could also be rule-based) with another type of analysis that focuses more on the context. This could be some kind of text classification, you could examine the dependency parse, etc.

Here is a simple example from the spacy docs about extracting entity relations using NER (to find MONEY ) followed by examining the dependency parse to try to figure out what the money element could be referring to:

https://spacy.io/usage/examples#entity-relations

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM