Skip to content

A question about function prepro_fn_gat_bert? #11

@hustcxx

Description

@hustcxx

What is the purpose of this processing code in prepro_fn_gat_bert()?

order_match = {}
count = 1
i = 0
for sents in [' '.join(source_sent)]:
sent_words = sents.split(' ')
if len(sent_words) > 0:
order_match[i] = list(range(count, count + align[sent_words[0]]))
count += align[sent_words[0]]
i += 1
for word in sent_words[1:]:
new_word = ' ' + word # if use bpe
#new_word = word
order_match[i] = list(range(count, count + align[new_word]))
# test_order_match[new_word] = [count, count + align[new_word]]
count += align[new_word]
i += 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions