Thanks for your reply.
I want to pool all word of one sentence to one, not just get the first.
And in the sentence_split_flag, 1 means the start of one sentence.
# the sentence segment could be represented like this :
sentence_segment = torch.LongTensor([0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1])