Relation Classification

#6
by jaycool - opened

Hi. First, thanks for this model. Think its a great tool. Just want to share a query I have using the example of text below:

text = "The introduction of co-feedstocks increased the CH4 production"

My current results are along the lines of:
[{'head': 'co-feedstock', 'type': 'product or material produced', 'tail': 'CH4'}]

I would like to use the transformer to produce something like:
[{'head': 'co-feedstock', 'type': 'increased', 'tail': 'CH4 (production)'}]

Does this fall under relation classification rather than relation extraction?

If so, how might I go about doing this using your model? I read in your paper that RC is possible.

Thanks again!

Babelscape org

Hi there, sorry for the late reply.

RC means that you provide the model with the head and tail entities. While rebel was not pretrained for RC, you can finetune on top of it with your own data (ie. a relation like increased). In the paper we did by adding special tokens before and after the head and tail entities within the text.

Our newly released multilingual model mrebel is pretrained also for RC, you can give it a try. Just add # before and after the head and @ for the tail:
"The introduction of # co-feedstocks # increased the @ CH4 production @"

And set the token as the first token to generate after the language code instead of . Be aware that this will return just one relation and that it will be from the ones seen during pretraining.

Best,
Pere-Lluis.

PereLluis13 changed discussion status to closed

Sign up or log in to comment