diff options
author | John Bauer <horatio@gmail.com> | 2022-09-14 05:52:32 +0300 |
---|---|---|
committer | John Bauer <horatio@gmail.com> | 2022-09-14 05:52:32 +0300 |
commit | f3a9a7226a0367c82f1d0f5483b106ccc08d6b32 (patch) | |
tree | f1a7bca5d209551aa92287b8f171cca2681b3677 | |
parent | 93191328e85b9cfe5365b54e8a02e416fb2cf727 (diff) |
Squeeze a little bit more - only use depparse in the depparse pipelinev1.4.1
-rw-r--r-- | stanza/tests/pipeline/test_depparse.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/stanza/tests/pipeline/test_depparse.py b/stanza/tests/pipeline/test_depparse.py index 7ad29aa2..4ad97451 100644 --- a/stanza/tests/pipeline/test_depparse.py +++ b/stanza/tests/pipeline/test_depparse.py @@ -61,10 +61,13 @@ EN_DOC_DEPENDENCY_PARSES_GOLD = """ ('.', 2, 'punct') """.strip() +@pytest.fixture(scope="module") +def en_depparse_pipeline(): + nlp = stanza.Pipeline(dir=TEST_MODELS_DIR, lang='en', processors='tokenize,pos,lemma,depparse') + return nlp -def test_depparse(): - nlp = stanza.Pipeline(dir=TEST_MODELS_DIR, lang='en') - doc = nlp(EN_DOC) +def test_depparse(en_depparse_pipeline): + doc = en_depparse_pipeline(EN_DOC) assert EN_DOC_DEPENDENCY_PARSES_GOLD == '\n\n'.join([sent.dependencies_string() for sent in doc.sentences]) |