snakeztc / SimDial

Synthetic task-oriented dialog generator with controllable complexity. It is released by Tiancheng Zhao (Tony) from Dialog Research Center, LTI, CMU
https://www.cs.cmu.edu/~tianchez
Apache License 2.0
51 stars 17 forks source link

Error while running multiple_domains.py #3

Open Mayanksoni20 opened 5 years ago

Mayanksoni20 commented 5 years ago
Traceback (most recent call last):
  File "mtrand.pyx", line 1115, in mtrand.RandomState.choice
TypeError: 'dict_keys' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "multiple_domains.py", line 311, in <module>
    gen_bot.gen_corpus("test", rest_spec, complexity.CleanSpec, test_size)
  File "C:\Users\Mayank\Desktop\GithubProjects\SimDial\simdial\generator.py", line 146, in gen_corpus
    corpus = self.gen(domain, complex, num_sess=size)
  File "C:\Users\Mayank\Desktop\GithubProjects\SimDial\simdial\generator.py", line 108, in gen
    usr = User(domain, complexity)
  File "C:\Users\Mayank\Desktop\GithubProjects\SimDial\simdial\agent\user.py", line 76, in __init__
    self.goal_cnt = np.random.choice(complexity.multi_goals.keys(), p=complexity.multi_goals.values())
  File "mtrand.pyx", line 1117, in mtrand.RandomState.choice
ValueError: 'a' must be 1-dimensional or an integer
QasimWani commented 3 years ago

i had similar issues when using python2.7. try running it in python3+ using this forked repo: https://github.com/ruinunca/SimDial it worked for me.