Encoder We first obtain representation vectors at the sentence level by putting one layer of LSTM (denoted as LST M word encode ) on top of its containing words: The vector output at the ending time-step is used to represent the entire sentence as To build representation e D for the current document/paragraph D, another layer of LSTM (denoted as LST M sentence encode ) is placed on top of all sentences, computing representations sequentially for each timestep: Representation e s end D computed at the final time step is used to represent the entire document: e D = h s end D .
one LSTM operates at the token level, leading to the acquisition of sentence-level representations that are then used as inputs into the second LSTM that acquires document-level representations, in a hierarchical structure.