Suppose I have a paragraph which explains the injuries and its descriptions. I want to extract the injuries and its corresponding descriptions from the text. How can I do that?
For example, the paragraph will be as follows:
In my opinion the neck pain is due to the soft tissue injury. The fracture on the hand will be resolved in 2 months. The pain in the shoulder and neck is due to the soft tissue injury. There is a stiffness and discomfort around the hip.
the expected output is :
{
"neck": ["soft tissue"],
"hand": ["fracture"],
"shoulder": [ "soft tissue"],
"hip": ["stiffness", "discomfort"]
}
Which NLP techniques can be used here?
We have two txt files for injuries and descriptions.
But how will we relate or match the description with its corresponding injury?
I tried the dependency parser but the problem is we have to write a number of patterns for each injury, we have more than 100 injuries and more than 100 descriptions. So if we are writing patterns for all the injuries there will be a large number of patterns and I think it will take too much time and power.
Are there any other ways to do this kind of extraction?
The paragraph doesn't have a common structure.
I'm using python and spacy for this.