emora-chat / emora_stdm

State Transition Dialogue Manager
25 stars 9 forks source link

'$' or '_' not allowed in NLG strings #19

Open talynfan opened 1 year ago

talynfan commented 1 year ago

The code:

from emora_stdm import DialogueFlow

df = DialogueFlow('start', end_state='end', transitions={
    'state': 'start',
    "`Hello, you just made $100 in cash!`": {
        'score': 2.0,
        'error': 'end'
    },
    "`I can't handle the $ sign.`": {
        'error': 'end'
    },
    "`You are very, very poor.`": {
        'score': 0.1,
        'error': 'end'
    }
})
df.run(debugging=True)

The debugging output:

C:\Users\tmail\.conda\envs\emora_venv\python.exe C:/Users/tmail/Documents/Emora_sandbox/tester_2.py
NatexNlg generation:
  Macros          WN ONT ONTE ONTUL KBQ KBE ONTN EXP ONT_NEG FPP TPP PSP GATE TRANSITION GOAL GCOM GEXT GSRET GRET GCLR VT CE EXTR JMP RET RPT MANAGE_STACK RW CONTRACTIONS TARGET DEFAULT UNSET CLR LEM SCORE TOKLIMIT EQ NOT U I DIF SET ALL IF ANY ISP IN RAND COPYGR REPEAT NORMALIZE AGREE DISAGREE QUESTION NEGATION IDK MAYBE CONFIRM UNINTERESTED NOTINTERESTED INTERESTED UNX PRIVATE
  Vars            __state__=start, __system_state__=start, __stack__=[], __user_utterance__=None, __goal_return_state__=None
  Steps             ------------------------------------------------------------
    Original        `You are very, very poor.`
  Final           You are very, very poor.
Transition ('start', '2', <Speaker.SYSTEM: 'SYSTEM'>) evaluated in 0.00200
NatexNlg generation:
  Macros          WN ONT ONTE ONTUL KBQ KBE ONTN EXP ONT_NEG FPP TPP PSP GATE TRANSITION GOAL GCOM GEXT GSRET GRET GCLR VT CE EXTR JMP RET RPT MANAGE_STACK RW CONTRACTIONS TARGET DEFAULT UNSET CLR LEM SCORE TOKLIMIT EQ NOT U I DIF SET ALL IF ANY ISP IN RAND COPYGR REPEAT NORMALIZE AGREE DISAGREE QUESTION NEGATION IDK MAYBE CONFIRM UNINTERESTED NOTINTERESTED INTERESTED UNX PRIVATE
  Vars            __state__=start, __system_state__=start, __stack__=[], __user_utterance__=None, __goal_return_state__=None
  Steps             ------------------------------------------------------------
    Original        `I can't handle the $ sign.`
  Final           I can't handle the $ sign.
Transition ('start', '1', <Speaker.SYSTEM: 'SYSTEM'>) evaluated in 0.00200
NatexNlg generation:
  Macros          WN ONT ONTE ONTUL KBQ KBE ONTN EXP ONT_NEG FPP TPP PSP GATE TRANSITION GOAL GCOM GEXT GSRET GRET GCLR VT CE EXTR JMP RET RPT MANAGE_STACK RW CONTRACTIONS TARGET DEFAULT UNSET CLR LEM SCORE TOKLIMIT EQ NOT U I DIF SET ALL IF ANY ISP IN RAND COPYGR REPEAT NORMALIZE AGREE DISAGREE QUESTION NEGATION IDK MAYBE CONFIRM UNINTERESTED NOTINTERESTED INTERESTED UNX PRIVATE
  Vars            __state__=start, __system_state__=start, __stack__=[], __user_utterance__=None, __goal_return_state__=None
  Steps             ------------------------------------------------------------
    Original        `Hello, you just made $100 in cash!`
  Final           Hello, you just made $100 in cash!
Transition ('start', '0', <Speaker.SYSTEM: 'SYSTEM'>) evaluated in 0.00200
Transition options: ------------
0.1 2: NatexNlg(`You are very, very poor.`)
--------------------------------
System transition in 0.00600
Transitioning start -> 2
System turn in 0.00600
Time delta: 0.00600
S: You are very, very poor.
U: 
talynfan commented 1 year ago

Same problem with the underscore '_'