fenchri / edge-oriented-graph

Source code for the EMNLP 2019 paper: "Connecting the Dots: Document-level Relation Extraction with Edge-oriented Graphs"
Other
145 stars 17 forks source link

some questions about the processed data #26

Closed Amadeus-JD closed 3 years ago

Amadeus-JD commented 3 years ago

PIDtokenized_sentences_separatedby|relationdirectioncross/non-crossclosest_arg1_start-closest_arg1_endclosest_arg2_start-closest_arg2_endarg1_KB_idmentions_for_arg1_separatedby|arg1_typestart_token_ids_arg1_separatedby:end_token_ids_arg1_separatedby:sentence_ids_separatedby:arg2_KB_idmentions_for_arg2_separatedby|arg2_typestart_token_ids_arg2_separatedby:end_token_ids_arg2_separatedby:sentence_ids_separatedby:

I saw this is the processed data format.... i want to ask what is direction mean??

why

                if p[1] == "L2R":
                    h_id, t_id = p[5], p[11]
                    h_start, t_start = p[8], p[14]
                    h_end, t_end = p[9], p[15]
                else:
                    t_id, h_id = p[5], p[11]
                    t_start, h_start = p[8], p[14]
                    t_end, h_end = p[9], p[15]

what is L2R and R2L why have to change the position of head entity and tail entity??

fenchri commented 3 years ago

Hello,

L2R and R2L simply indicate the order to the entities in the sentence, which one appears first and which one appears second (left-to-right and right-to-left). It doesn't play much role in CDR and GDA because we want interactions between specific entity types. But generally, the order of the entities influences the direction of the relation (from the 1st entity to the 2nd or from the 2nd to the 1st).

Amadeus-JD commented 3 years ago

Hello,

L2R and R2L simply indicate the order to the entities in the sentence, which one appears first and which one appears second (left-to-right and right-to-left). It doesn't play much role in CDR and GDA because we want interactions between specific entity types. But generally, the order of the entities influences the direction of the relation (from the 1st entity to the 2nd or from the 2nd to the 1st).

thank you so much... . I want to make sure that the head entity is Chemical and tail entity is Disease... Could I just change this Module。。(with do not judge the p[1]'s value....) to achieve this goal?

fenchri commented 3 years ago

The model makes sure that it classifies the pair with head entity Chemical and tail Disease, you don't need to change anything in the script.

Amadeus-JD commented 3 years ago

The model makes sure that it classifies the pair with head entity Chemical and tail Disease, you don't need to change anything in the script.

OK.....thank you so much