stanfordnlp / cocoa

Framework for learning dialogue agents in a two-player game setting.
MIT License
158 stars 62 forks source link

Model name problem #56

Closed rzhao1 closed 4 years ago

rzhao1 commented 5 years ago

Could you please clarify the meaning of each model in the code of paper "Decoupling Strategy and Generation in Negotiation Dialogues"?

  1. "rulebased"
  2. "hybrid"
  3. "cmd"
  4. "fb-neural"
  5. "pt-neural"

Thank you very much!

hhexiy commented 5 years ago

rulebased: rule parser + rule policy + retrieval generator hybrid: rule parser + learned policy + retrieval generator cmd: human-controlled bot used in a command line interface fb-neural: obsolete pt-neural: seq2seq

rzhao1 commented 5 years ago

Thank you for the clarification! It is really helpful! Basically, I want to run use hybrid model to generate the simulated dialogue. However, when I run the following command, I got the error "AttributeError: 'HybridSystem' object has no attribute 'env'".

PYTHONPATH=. python reinforce.py --schema-path data/bookhatball-schema.json \ --scenarios-path data/train-scenarios.json \ --valid-scenarios-path data/val-scenarios.json \ --agent-checkpoints checkpoint/lf2lf/model_best.pt checkpoint/lf2lf/model_best.pt \ --model-path checkpoint/lf2lf-margin \ --optim adagrad --learning-rate 0.001 \ --agents hybrid pt-neural \ --report-every 500 --max-turns 20 --num-dialogues 5000 \ --sample --temperature 0.5 --max-length 20 --reward margin\ -- templates templates.pkl\ --policy model.pkl

rzhao1 commented 5 years ago

I noticed that HybridSystem class does not have function of loading trained policy?

hhexiy commented 5 years ago

The parameters are loaded through the manager object of HybridSystem, which is the learned policy. Also, I don't think the command would run, because you cannot back-propagate through hybrid.

rzhao1 commented 5 years ago

Thank you! If I want to create an agent that use neural dialogue model as manager and rule-based template as generator (a hybrid system) to talk with human user, which kind of command I should use? The default commands you provided in README only output dialogue act instead of the utterance?

rzhao1 commented 5 years ago

One more extra question: what does it mean lf2lf vs lflm? Thank you!

hhexiy commented 5 years ago

You can use https://github.com/stanfordnlp/cocoa/blob/master/scripts/generate_dataset.py to generate bot-bot/human chat by setting one agent to be hybrid and the other to be cmd (human). lflm means learning a LM as the action predictor instead of a seq2seq model, this is obsolete though.

rzhao1 commented 5 years ago

Thank you! What does "LF" stand for?

hhexiy commented 5 years ago

logical form