Combine and fix botsociety export

print to console

python3 ./botsociety-convert.py example/nlu.yaml example/exported.json

or to file

python3 ./botsociety-convert.py example/nlu.yaml example/exported.json example/stories.yaml

Why do this?

the stories.yaml exported from botsociety:

version: '2.0'
stories:
  - story: happy1
    steps:
      - action: utter_show_help
      - intent: inform
      - action: utter_ask_date
      - intent: inform
      - action: utter_show_weather
  - story: happy2
    steps:
      - action: utter_show_help
      - intent: inform
      - action: utter_show_weather
  - story: happy3
    steps:
      - action: utter_show_help
      - intent: inform
      - action: utter_ask_location
      - intent: inform
      - action: utter_show_weather

the stories generated by this script:

version: '2.0'
stories:
  - story: happy1
    steps:
      - action: utter_show_help
      - intent: inform
        entities:
        - location: 上海
      - action: utter_ask_date
      - intent: inform
        entities:
        - date: 明天
      - action: utter_show_weather
  - story: happy2
    steps:
      - action: utter_show_help
      - intent: inform
        entities:
        - date: 明天
        - location: 北京
      - action: utter_show_weather
  - story: happy3
    steps:
      - action: utter_show_help
      - intent: inform
        entities:
        - date: 后天
      - action: utter_ask_location
      - intent: inform
        entities:
        - location: 北京
      - action: utter_show_weather