def test_load_transformers(name): cfg = f""" lang: name: en pipeline: transformers_model: trf_name_or_path: {name} """ load(cfg)
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
def nlp(): return load("knp")
def nlp(): _nlp = load("knp") _nlp.add_pipe(_nlp.create_pipe("knp_parallel_noun_chunker")) return _nlp