oppo-text-match
oppo-text-match copied to clipboard
segment_ids 是否需要区分text1,text2?
bert 模型有3输入: input_ids: cls text1_id sep text2_id sep token_types_ids:[0](len(text1_ids)+2)+[1](len(text2_ids)+1) attention_mask:[1]*len(input_ids) 看到源码里的sample_convert 函数里对于segment_ids 的定义没有区分句子1和句子2,请问区分一下是不是更好一些?
同问, 看苏神其他项目也是这么写的, 可能这样效果更好, 但是不太明白其中的道理~