ConvLab-3 icon indicating copy to clipboard operation
ConvLab-3 copied to clipboard

[BUG] purpose of repeated code

Open Ahmed-Mahmod-Salem opened this issue 10 months ago • 2 comments

Hello, I have been trying to understand the code inthe mulutwoz_eval.py file, to be able to extend it on any dataset, at the beginning I see a repeated block of code namely this: `

REF_SYS_DA_M = {}
for dom, ref_slots in REF_SYS_DA.items():
    dom = dom.lower()
    REF_SYS_DA_M[dom] = {}
    for slot_a, slot_b in ref_slots.items():
        if slot_a == 'Ref':
            slot_b = 'ref'
        REF_SYS_DA_M[dom][slot_a.lower()] = slot_b
    REF_SYS_DA_M[dom]['none'] = 'none'
REF_SYS_DA_M['taxi']['phone'] = 'phone'
REF_SYS_DA_M['taxi']['car'] = 'car type'
DEF_VAL_UNK = '?'  # Unknown
DEF_VAL_DNC = 'dontcare'  # Do not care
DEF_VAL_NUL = 'none'  # for none
DEF_VAL_BOOKED = 'yes'  # for booked
DEF_VAL_NOBOOK = 'no'  # for booked

` from lines 63 to 78 is repeated, I don't want to break it, so I anyone has any idea why is this code written like this it would be a great help

also if the repo owner would add a readme file and a little more descriptive comment on the methods of the Evaluator class, that would be appreciated very much sincerely.

Ahmed-Mahmod-Salem avatar Apr 01 '24 09:04 Ahmed-Mahmod-Salem