Hi All,
I am new to information extraction and especially to Spacy so my apologies in advance if the question is too naive.
I have the following text:
In the last year, Medical AI firms had raised even more, with AICare and DeepScan, raising £2million and £5million, respectively.
The NER model shows it as follows:
I want to extract information in the following format:
The starter code is
text = "In last year, Medical AI startups had won even more, with AICare and DeepScan, raising $2million and $5million, respectively."
def get_nlp():
nlp = spacy.load("en_core_web_sm")
ruler = EntityRuler(nlp, overwrite_ents=True)
patterns = [{"label": "RESEARCHSTRAND", "pattern":[{"lower": "medical"}, {"lower": "ai"}]},
{"label": "COMPANY", "pattern":[{"lower": "aicare"}]},
{"label": "COMPANY", "pattern":[{"lower": "deepscan"}]},
]
ruler.add_patterns(patterns)
nlp.add_pipe(ruler, before="ner")
return nlp(raw_text)
doc = get_nlp(text)
displacy.render(doc, jupyter=True, style='ent')
Any idea on how to achieve this task. I will greatly appreciate your support.
Many Thanks and
Kind Regards,
Muhhas