Пример #1
0
def get_task(config: configure_finetuning.FinetuningConfig, task_name,
             tokenizer):
    """Get an instance of a task based on its name."""
    if task_name == "cola":
        return classification_tasks.CoLA(config, tokenizer)
    elif task_name == "mrpc":
        return classification_tasks.MRPC(config, tokenizer)
    elif task_name == "mnli":
        return classification_tasks.MNLI(config, tokenizer)
    elif task_name == "sst":
        return classification_tasks.SST(config, tokenizer)
    elif task_name == "rte":
        return classification_tasks.RTE(config, tokenizer)
    elif task_name == "qnli":
        return classification_tasks.QNLI(config, tokenizer)
    elif task_name == "qqp":
        return classification_tasks.QQP(config, tokenizer)
    elif task_name == "sts":
        return classification_tasks.STS(config, tokenizer)
    elif task_name == "yesno":
        return classification_tasks.BioYesNo(config, tokenizer)
    elif task_name == "reranker":
        return classification_tasks.BioAnswerFinderReranker(config, tokenizer)
    elif task_name == "weighted-reranker":
        return classification_tasks.BioAnswerFinderWeightedReranker(
            config, tokenizer, [1.0, 99.0])
    elif task_name == "gad":
        return classification_tasks.BioREGAD(config, tokenizer)
    elif task_name == "euadr":
        return classification_tasks.BioREEUADR(config, tokenizer)
    elif task_name == "chemprot":
        return classification_tasks.BioREChemProt(config, tokenizer)
    elif task_name == "squad":
        return qa_tasks.SQuAD(config, tokenizer)
    elif task_name == "squadv1":
        return qa_tasks.SQuADv1(config, tokenizer)
    elif task_name == "bioasq":
        return qa_tasks.BioASQ(config, tokenizer)
    elif task_name == "newsqa":
        return qa_tasks.NewsQA(config, tokenizer)
    elif task_name == "naturalqs":
        return qa_tasks.NaturalQuestions(config, tokenizer)
    elif task_name == "triviaqa":
        return qa_tasks.TriviaQA(config, tokenizer)
    elif task_name == "searchqa":
        return qa_tasks.SearchQA(config, tokenizer)
    elif task_name == "chunk":
        return tagging_tasks.Chunking(config, tokenizer)
    elif task_name == "bionlp13pc":
        return tagging_tasks.BioNLP13PCNER(config, tokenizer)
    elif task_name == "bc4chemd":
        return tagging_tasks.BC4CHEMD_NER(config, tokenizer)
    elif task_name == "bc2gm":
        return tagging_tasks.BC2GM_NER(config, tokenizer)
    elif task_name == 'linnaeus':
        return tagging_tasks.Linnaeus_NER(config, tokenizer)
    elif task_name == "ncbi-disease":
        return tagging_tasks.NCBI_Disease_NER(config, tokenizer)
    else:
        raise ValueError("Unknown task " + task_name)
Пример #2
0
def get_task(config: configure_finetuning.FinetuningConfig, task_name,
             tokenizer):
    """Get an instance of a task based on its name."""
    if task_name == "cola":
        return classification_tasks.CoLA(config, tokenizer)
    elif task_name == "mrpc":
        return classification_tasks.MRPC(config, tokenizer)
    elif task_name == "mnli":
        return classification_tasks.MNLI(config, tokenizer)
    elif task_name == "sst":
        return classification_tasks.SST(config, tokenizer)
    elif task_name == "rte":
        return classification_tasks.RTE(config, tokenizer)
    elif task_name == "qnli":
        return classification_tasks.QNLI(config, tokenizer)
    elif task_name == "qqp":
        return classification_tasks.QQP(config, tokenizer)
    elif task_name == "sts":
        return classification_tasks.STS(config, tokenizer)
    elif task_name == "squad":
        return qa_tasks.SQuAD(config, tokenizer)
    elif task_name == "squadv1":
        return qa_tasks.SQuADv1(config, tokenizer)
    elif task_name == "newsqa":
        return qa_tasks.NewsQA(config, tokenizer)
    elif task_name == "naturalqs":
        return qa_tasks.NaturalQuestions(config, tokenizer)
    elif task_name == "triviaqa":
        return qa_tasks.TriviaQA(config, tokenizer)
    elif task_name == "searchqa":
        return qa_tasks.SearchQA(config, tokenizer)
    elif task_name == "chunk":
        return tagging_tasks.Chunking(config, tokenizer)
    else:
        raise ValueError("Unknown task " + task_name)
Пример #3
0
def get_task(config: configure_finetuning.FinetuningConfig, task_name,
             tokenizer):
    """Get an instance of a task based on its name."""
    if task_name == "cola":
        return classification_tasks.CoLA(config, tokenizer)
    elif task_name == "mrpc":
        return classification_tasks.MRPC(config, tokenizer)
    elif task_name == "mnli":
        return classification_tasks.MNLI(config, tokenizer)
    elif task_name == "sst":
        return classification_tasks.SST(config, tokenizer)
    elif task_name == "rte":
        return classification_tasks.RTE(config, tokenizer)
    elif task_name == "qnli":
        return classification_tasks.QNLI(config, tokenizer)
    elif task_name == "qqp":
        return classification_tasks.QQP(config, tokenizer)
    elif task_name == "sts":
        return classification_tasks.STS(config, tokenizer)
    elif task_name == "squad":
        return qa_tasks.SQuAD(config, tokenizer)
    elif task_name == "squadv1":
        return qa_tasks.SQuADv1(config, tokenizer)
    elif task_name == "newsqa":
        return qa_tasks.NewsQA(config, tokenizer)
    elif task_name == "naturalqs":
        return qa_tasks.NaturalQuestions(config, tokenizer)
    elif task_name == "triviaqa":
        return qa_tasks.TriviaQA(config, tokenizer)
    elif task_name == "searchqa":
        return qa_tasks.SearchQA(config, tokenizer)
    elif task_name == "chunk":
        return tagging_tasks.Chunking(config, tokenizer)
    elif task_name == "biosses":
        return classification_tasks.Biosses(config, tokenizer)
    elif task_name == "bc5cdr":
        return tagging_tasks.NER(config, tokenizer)
    elif task_name == "hoc":
        return classification_tasks.HOC(config, tokenizer)
    elif task_name == "ddi":
        return classification_tasks.DDI(config, tokenizer)
    elif task_name == "chemprot":
        return classification_tasks.ChemProt(config, tokenizer)
    elif task_name == "chem":
        return tagging_tasks.BC5CDR_Chem(config, tokenizer)
    elif task_name == "disease":
        return tagging_tasks.BC5CDR_Disease(config, tokenizer)
    elif task_name == "conll2003_span":
        return tagging_tasks.CoNLL2003Span(config, tokenizer)
    elif task_name == "conll2003":
        return tagging_tasks.CoNLL2003(config, tokenizer)
    elif task_name == "wnut2016":
        return tagging_tasks.WNUT2016(config, tokenizer)
    elif task_name == "wnut2016_span":
        return tagging_tasks.WNUT2016Span(config, tokenizer)
    elif task_name == "fin":
        return tagging_tasks.FIN(config, tokenizer)
    elif task_name == "fin_span":
        return tagging_tasks.FINSpan(config, tokenizer)
    elif task_name == "jnlpba":
        return tagging_tasks.JNLPBA(config, tokenizer)
    elif task_name == "jnlpba_span":
        return tagging_tasks.JNLPBASpan(config, tokenizer)
    elif task_name == "bc2gm":
        return tagging_tasks.BC2GM(config, tokenizer)
    elif task_name == "bc2gm_span":
        return tagging_tasks.BC2GMSpan(config, tokenizer)
    elif task_name == "bionlp09":
        return tagging_tasks.BioNLP09(config, tokenizer)
    elif task_name == "bionlp09_span":
        return tagging_tasks.BioNLP09Span(config, tokenizer)
    elif task_name == "bionlp11epi":
        return tagging_tasks.BioNLP11EPI(config, tokenizer)
    elif task_name == "bionlp11epi_span":
        return tagging_tasks.BioNLP11EPISpan(config, tokenizer)
    elif task_name == "ner_span":
        return tagging_tasks.NERSpan(config, tokenizer)
    else:
        raise ValueError("Unknown task " + task_name)
Пример #4
0
def get_task(config: configure_finetuning.FinetuningConfig, task_name,
             tokenizer):
    """Get an instance of a task based on its name."""
    if task_name == "cola":
        return classification_tasks.CoLA(config, tokenizer)
    elif task_name == "mrpc":
        return classification_tasks.MRPC(config, tokenizer)
    elif task_name == "mnli":
        return classification_tasks.MNLI(config, tokenizer)
    elif task_name == "sst":
        return classification_tasks.SST(config, tokenizer)
    elif task_name == "rte":
        return classification_tasks.RTE(config, tokenizer)
    elif task_name == "qnli":
        return classification_tasks.QNLI(config, tokenizer)
    elif task_name == "qqp":
        return classification_tasks.QQP(config, tokenizer)
    elif task_name == "sts":
        return classification_tasks.STS(config, tokenizer)
    elif task_name == "squad":
        return qa_tasks.SQuAD(config, tokenizer)
    elif task_name == "squadv1":
        return qa_tasks.SQuADv1(config, tokenizer)
    elif task_name == "newsqa":
        return qa_tasks.NewsQA(config, tokenizer)
    elif task_name == "naturalqs":
        return qa_tasks.NaturalQuestions(config, tokenizer)
    elif task_name == "triviaqa":
        return qa_tasks.TriviaQA(config, tokenizer)
    elif task_name == "searchqa":
        return qa_tasks.SearchQA(config, tokenizer)
    elif task_name == "chunk":
        return tagging_tasks.Chunking(config, tokenizer)
    elif task_name == "bqcorpus":
        return classification_tasks.BQCorpus(config, tokenizer)
    elif task_name == "chnsenticorp":
        return classification_tasks.ChnSentiCorp(config, tokenizer)
    elif task_name == "xnli":
        return classification_tasks.XNLI(config, tokenizer)
    elif task_name == "lcqmc":
        return classification_tasks.LCQMC(config, tokenizer)
    elif task_name == "cmrc2018":
        return qa_tasks.CMRC2018(config, tokenizer)
    elif task_name == "drcd":
        return qa_tasks.DRCD(config, tokenizer)
    elif task_name == "ccks42ec":
        return classification_tasks.CCKS42EC(config, tokenizer)
    elif task_name == "ccks42ee":
        return qa_tasks.CCKS42EE(config, tokenizer)
    elif task_name == "ccks42single":
        return qa_tasks.CCKS42SINGLE(config, tokenizer)
    elif task_name == "ccks42multi":
        return qa_tasks.CCKS42MULTI(config, tokenizer)
    elif task_name == "ner":
        return tagging_tasks.Ner(config, tokenizer)
    elif task_name == "ccks42num":
        return classification_tasks.CCKS42NUM(config, tokenizer)
    elif task_name == "ccks42reg":
        return classification_tasks.CCKS42REG(config, tokenizer)
    else:
        raise ValueError("Unknown task " + task_name)