I was trying to run the few_joint_slu_1_bert.sh for snips and I had some errors to fix those I will give a short explanation:
the data_dir according to the generated few-shot in the MetaDialog github should change to
data_dir=${base_data_dir}${dataset}.spt_s_${support_shots}.q_s_20.ep_100.cross_id_${cross_data_id}/
in models/modules/seq_labeler.py the from torchcrf import CRF should be replaced with from TorchCRF import CRF
in models/few_shot_slu.py the from models.hopfield import Hopfield, HopfieldCore, HopfieldPooling is not used and cause error as it doesn't exist so it can be removed
in utils/data_loader.py when we use a sent_label split which means joint SF and IC, the few-shot is a list and not a dictionary with domain_name. so the domain_name should be deleted from --init-- . here is the corrected script:
coding:utf-8
import json
import collections
import random
from typing import List, Tuple, Dict
class RawDataLoaderBase:
def init(self, *args, **kwargs):
pass
Hi,
I was trying to run the
few_joint_slu_1_bert.sh
for snips and I had some errors to fix those I will give a short explanation:the
data_dir
according to the generated few-shot in the MetaDialog github should change todata_dir=${base_data_dir}${dataset}.spt_s_${support_shots}.q_s_20.ep_100.cross_id_${cross_data_id}/
in
models/modules/seq_labeler.py
thefrom torchcrf import CRF
should be replaced withfrom TorchCRF import CRF
in models/few_shot_slu.py the
from models.hopfield import Hopfield, HopfieldCore, HopfieldPooling
is not used and cause error as it doesn't exist so it can be removedin
utils/data_loader.py
when we use asent_label
split which means joint SF and IC, the few-shot is a list and not a dictionary with domain_name. so thedomain_name
should be deleted from --init-- . here is the corrected script: coding:utf-8 import json import collections import random from typing import List, Tuple, Dictclass RawDataLoaderBase: def init(self, *args, **kwargs): pass
DataItem = collections.namedtuple("DataItem", ["seq_in", "seq_out", "label"])
class FewShotExample(object): """ Each few-shot example is a pair of (one query example, support set) """
class FewShotRawDataLoader(RawDataLoaderBase): def init(self, opt): super(FewShotRawDataLoader, self).init() self.opt = opt self.debugging = opt.do_debug