keavil / AAAI18-code

The code of AAAI18 paper "Learning Structured Representation for Text Classification via Reinforcement Learning".
216 stars 81 forks source link

PNet and CNet Implementations #7

Open NSanjay opened 5 years ago

NSanjay commented 5 years ago

Hi

I was going through the paper and the implementation briefly. The implementation contains folders for the ID_LSTM and HS_LSTM parts of the solution. Are the PNet and CNet implementations a part of these folders or are they to be implemented separately? Also in Page 5, it is mentioned "For HS-LSTM, we split a sentence into phrases shorter than the square root of sentence length, and also use some very simple heuristics". Can you please elaborate on what the heuristics are?

Thank You

scofield7419 commented 5 years ago

Hi there. I may help to answer your questions.

  1. In the implementations, Pnet points to the ActorNetwork. And the Cnet along with the Representation net point to the LSTM-CriticNetwork, which means, first the authors use the actor-critic RL as the extract implementation, second, they design the LSTM representation net (also critic) along with Cnet together into one file. I suggest you carefully read the source.
  2. I found the specific implementation at the Datamanager.py in corresponding fold. the code's is like: look_action(sent, action, int(np.sqrt(lens) + 0.5))