I want to deal with the passage to get the summary using the GRU.
However, I have to load one passage once time as the batch (It is slow). For the different passage, we have to put the sentences from other passage to a new model (I mean not to goes along with the last GRU from the previous sentence). So I can not just input one passage each time.
So how can I deal with this problem? Setting the label on each sentence stands for different passage or record the passage’s sentence?
I want to feed several passages at once in a batch(for example, 64 passages) so I can compute many passage parallelly with my GPU.
But I don’t know how to differentiate the sentences from different passages.
For example: sentence1 and sentence2 are from the passage1, sentence3 and sentence4 are from passage2。
(In each sentence we have the words’ embeddings,
so my input dimensions is [batch_size, sentence_length, word_embedding])
[sentence1,
sentence2,
sentence3,
sentence4]
If I put all sentence in one big matrix(Tensor) and Feed to GRU(Because I want to use the embedding of the passage)
Then the GRU will connect them all together in one line. sentence1 → sentence2 → sentence3 → sentence4
What I want to do is(1、2 and 3、4 are independent): sentence1 → sentence2 (For passage1) sentence3 → sentence4 (For passage2)
But I don’t know how, so I have to write a loop to input every passage once time, which is much slow.
No. RNN will not connect sequences in a batch together. For connecting sentence1~4 together, you need to concatenate them along the sequence_length dimension.