oppo-text-match icon indicating copy to clipboard operation
oppo-text-match copied to clipboard

segment_ids 是否需要区分text1,text2?

Open husheng-liu opened this issue 3 years ago • 1 comments

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,请问区分一下是不是更好一些?

husheng-liu avatar Aug 31 '21 04:08 husheng-liu

同问, 看苏神其他项目也是这么写的, 可能这样效果更好, 但是不太明白其中的道理~

underspirit avatar Jun 22 '22 09:06 underspirit