コード例 #1
0
ファイル: agents.py プロジェクト: kimsan0622/anonymous_kowow
    def _path(opt):
        build(opt)
        dt = opt['datatype'].split(':')[0]

        if dt == 'train':
            path = os.path.join(opt['datapath'], 'DialogueQE', 'train.json')
        elif dt == 'test':
            path = os.path.join(opt['datapath'], 'DialogueQE', 'test.json')
        elif dt == 'valid':
            logging.error(
                'warning: validation is not supported in dialogue_qe. Using test'
            )
            path = os.path.join(opt['datapath'], 'DialogueQE', 'test.json')
        else:
            raise RuntimeError('Not valid datatype.')

        return path
コード例 #2
0
    def _path(opt):
        import os
        import sys
        from parlai.tasks.dialogue_qe.build import build
        build(opt)
        dt = opt['datatype'].split(':')[0]

        if dt == 'train':
            path = os.path.join(opt['datapath'], 'DialogueQE', 'train.json')
        elif dt == 'test':
            path = os.path.join(opt['datapath'], 'DialogueQE', 'test.json')
        elif dt == 'valid':
            print('warning: validation is not supporting', file=sys.stderr)
            path = None
        else:
            raise RuntimeError('Not valid datatype.')

        return path