OpenNRE icon indicating copy to clipboard operation
OpenNRE copied to clipboard

Question about BagOne

Open pminervini opened this issue 3 years ago • 0 comments

I was checking the BagOne class, and on this line:

https://github.com/thunlp/OpenNRE/blob/0acd945d9fc94761a10e721af385c7cdb9e55997/opennre/model/bag_one.py#L46

the method sentence_encoder.tokenizer was being used in this way:

token, pos1, pos2, mask = self.sentence_encoder.tokenize(item)

However, aren't the position of pos1 and masks flipped? And, what if the masks entry is not being returned? E.g. see here:

Different order of the returned values: https://github.com/thunlp/OpenNRE/blob/master/opennre/encoder/bert_encoder.py#L215

No masks returned: https://github.com/thunlp/OpenNRE/blob/0acd945d9fc94761a10e721af385c7cdb9e55997/opennre/encoder/base_encoder.py#L154

pminervini avatar Jan 03 '22 19:01 pminervini