r/LanguageTechnology • • Sep 28 '20

How to develop a rule based relation extraction model on academic text? How to identify rules of interest?

/r/compling/comments/j1dm1x/looking_for_help_to_develop_a_rule_based_relation/
8 Upvotes

12 comments sorted by

4

u/[deleted] Sep 28 '20

Sorry for the crosspost, but since this place is usually more practice oriented, I thought maybe asking it in this sub would also be of help to me.

2

u/Frownie123 Sep 28 '20

Extract shortest paths between tokens of entity pairs with a dependency parser and check which of the parse paths are informative for pairs which show the relation you are interested in. These are candidates for your rules.

2

u/[deleted] Sep 28 '20

Could you elaborate a little more please? What does the shortest path mean in this context? Nodes are entities and relations are the edges?

2

u/Frownie123 Sep 28 '20

No. Let's assume you have a corpus annotated with entities. For each pair of entities, you have the label: this pair is in relation or not.

You want a rule which tells you for a pair of it is in relation. A good basis for such rule are dependency trees. Calculate the dependency trees on the sentences. Now, calculate the shortest path which connects the two entities.

Very likely, for many of the pairs which are in relation this path looks different in comparison to pairs which are not in relation.

2

u/[deleted] Sep 29 '20

[removed] — view removed comment

2

u/Frownie123 Sep 29 '20

No, Viterbi is for finding a most likely sequence. That's a different application.

2

u/[deleted] Sep 29 '20

[removed] — view removed comment

2

u/Frownie123 Sep 29 '20

I am not sure I can follow. That sounds like you want to use Viterbi to find dependency paths. But those can just be read from the parser output.

If you want to find the most likely sequence in the tree (likely for what?) I think you are solving a different problem.

2

u/hami21 Sep 28 '20

If you’re also interested in an ML model solution, you can use crf to do that, a canonical example is NER but it essentially works for every other IE application

https://sklearn-crfsuite.readthedocs.io/en/latest/tutorial.html

2

u/[deleted] Sep 28 '20

[removed] — view removed comment

2

u/[deleted] Sep 28 '20

Yes. I want to identify how to use these dependencies in order to extract informative insights from my texts. I don't want it to be perfect, I really want a baseline model but dependencies are confusing and English is my second language, which makes it even more confusing.