コード例 #1
0
from emora_stdm import DialogueFlow

system = DialogueFlow("start",
                      end_state="end",
                      initial_speaker=DialogueFlow.Speaker.USER)
system.load_transitions({
    "state": "start",
    "[{hi, hello}]": {
        "`Hi!`": {
            "score": 3.0,
            "error": {
                "`Bye.`": "end"
            }
        }
    },
    "error": {
        "`Bye`": "end"
    },
})

system.load_update_rules({
    "[news]": "`Coronavirus, argh!` (4.0)",
    "[{movie, movies}]": "`Avengers is a good one.` (4.0)",
    "/.*/ (0.1)": "`I'm not sure I understand.` (2.0)",
})

if __name__ == "__main__":
    system.run(debugging=True)
コード例 #2
0
from emora_stdm import DialogueFlow

system = DialogueFlow('start', initial_speaker=DialogueFlow.Speaker.USER)
system.load_transitions({'state': 'start'})

system.load_update_rules({
    '[my, {husband, wife, kids}]': '#SET($is_adult=True)',
    '{[i, work]}': '#SET($is_adult=True)',
    '#IF($is_adult=True)': '`How is you job going?` (2.0)',
    '/.*/ (0.1)': '`I\'m not sure I understand.` (1)',
})

if __name__ == '__main__':
    system.run()
コード例 #3
0
from emora_stdm import DialogueFlow


system = DialogueFlow('start', end_state='end', initial_speaker=DialogueFlow.Speaker.USER)
system.load_transitions({
    'state': 'start',

    '[{hi, hello}]': {

         '`Hi!`':{
             'score': 3.0,

             'error': { '`Bye.`': 'end' }
         }
    },

    'error': { '`Bye`': 'end' }
})

system.load_update_rules({
    '[news]': '`Coronavirus, argh!` (4.0)',
    '[{movie, movies}]': '`Avengers is a good one.` (4.0)',
    '/.*/ (0.1)': '`I\'m not sure I understand.` (2.0)',
})

if __name__ == '__main__':
    system.run(debugging=True)
コード例 #4
0
ファイル: reasoning_example.py プロジェクト: kudep/emora_stdm
from emora_stdm import DialogueFlow


system = DialogueFlow("start", initial_speaker=DialogueFlow.Speaker.USER)
system.load_transitions({"state": "start"})

system.load_update_rules(
    {
        "[my, {husband, wife, kids}]": "#SET($is_adult=True)",
        "{[i, work]}": "#SET($is_adult=True)",
        "#IF($is_adult=True)": "`How is you job going?` (2.0)",
        "/.*/ (0.1)": "`I'm not sure I understand.` (1)",
    }
)

if __name__ == "__main__":
    system.run()