-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
I have a question about code implementation. First, in the doc.py section
def vectorize(self) -> dict:
head_desc, tail_desc = self.head_desc, self.tail_desc
if args.use_link_graph:
if len(head_desc.split()) < 20:
head_desc += ' ' + get_neighbor_desc(head_id=self.head_id, tail_id=self.tail_id)
if len(tail_desc.split()) < 20:
tail_desc += ' ' + get_neighbor_desc(head_id=self.tail_id, tail_id=self.head_id)
head_word = _parse_entity_name(self.head)
head_text = _concat_name_desc(head_word, head_desc)
hr_encoded_inputs = _custom_tokenize(text=head_text,
text_pair=self.relation)
head_encoded_inputs = _custom_tokenize(text=head_text)
tail_word = _parse_entity_name(self.tail)
tail_encoded_inputs = _custom_tokenize(text=_concat_name_desc(tail_word, tail_desc))Looking at this part, when the number of tokens is less than 20, the description of the neighbors is included.
By the way, in the predict.py file
args.use_link_graph = self.train_args.use_link_graph
args.is_test = TrueAccording to this part, additional description will be included in the test, so isn't the description of the tail, which is the correct answer, even though the problem solving in the knowledge graph is to match the tail when the head and relation are given?
Metadata
Metadata
Assignees
Labels
No labels