declare-lab / RelationPrompt

This repository implements our ACL Findings 2022 research paper RelationPrompt: Leveraging Prompts to Generate Synthetic Data for Zero-Shot Relation Triplet Extraction. The goal of Zero-Shot Relation Triplet Extraction (ZeroRTE) is to extract relation triplets of the format (head entity, tail entity, relation), despite not having annotated data for the test relation labels.
MIT License
122 stars 16 forks source link

Zero shot Relation classification #8

Closed arian1995 closed 2 years ago

arian1995 commented 2 years ago

Hi, Nice paper In the paper you reported Zero shot Relation classification results but here I didn't see any code for that. didn't you release the code? or should I change the existing one for extraction?

chiayewken commented 2 years ago

Hi, thank you for the kind comment :) Sorry we have not yet released the specific code for ZeroRC as it requires a different data processing pipeline to be consistent with the previous benchmark. As I'm currently busy with another project, it may take a few weeks to integrate into the current repository.

arian1995 commented 2 years ago

Thanks

jbrry commented 1 year ago

What changes to the data processing pipeline would need to be made?

Can we not just change the extraction setup to include the test head and tail entity in the prompt and get the model to generate the relation as in Figure 4b? Also is the generation of the relation conditioned on the number of unseen relations or is it over the full tokenizer vocabulary?

jbrry commented 1 year ago

I think I understand why it is more appropriate to do this in the data processing stage. Basically we need to modify all input files passed to the extractor model.

Currently it is done here in encoder.encode_to_line. We would need to make a similar function to take the head and tail entities out of the summary and into the input text, so the input contains the context, head and tail, and the output is just the relation.