stanfordnlp / cocoa

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

How to restrict being selected scenarios in craigslistbargain #54

Closed Mocchaso closed 4 years ago

Mocchaso commented 5 years ago

I'd like to select only the scenario that rulebased is the seller and human is the buyer. However, I can't understand how to do this.

What should I change in craigslistbargain to restrict being selected scenarios?

hhexiy commented 5 years ago

scenarios are separated from the agents. when you build the session, you can check if kb.role == 'seller' and give that kb to the rulebased seller.

Mocchaso commented 5 years ago

Thank you for commenting.

I could restrict a scenario to rulebased is seller.

The following error occurred, but I guess that this is no problem because this error occurs when the selected scenario is not rulebased: seller. Furthermore, backend.py select a scenario until being selected a scenario of rulebased: seller.

Is my thought correct...?

cocoa_src/cocoa/web/main/backend.py, in line 320
  config = bot_session.config
AttributeError: 'NoneType' object has no attribute 'config'
hhexiy commented 4 years ago

Hmm. I'm not sure that I fully understand your thoughts. But what I was suggesting is that you don't have to change the backend (i.e. scenario loading), you can directly set the agents accordingly when you build the session. The scenario itself does not specify who's the seller and who's the buyer.