Beispiel #1
0
def test_load_transformers(name):
    cfg = f"""
    lang:
        name: en
    pipeline:
        transformers_model:
            trf_name_or_path: {name}
    """
    load(cfg)
Beispiel #2
0
def test_kbeam_config(labels):
    nlp = load(f"""
    lang:
        name: ja_mecab
    pipeline:
        {TRANSFORMERS_NER}:
            k_beam: 111
            labels: {labels}
    pretrained: {BERT_DIR}
    """)
    ner = nlp.get_pipe(TRANSFORMERS_NER)
    assert ner.k_beam == 111
Beispiel #3
0
def nlp():
    return load("knp")
Beispiel #4
0
def nlp():
    _nlp = load("knp")
    _nlp.add_pipe(_nlp.create_pipe("knp_parallel_noun_chunker"))
    return _nlp