Skip to content

Commit

Permalink
Merge pull request #3091 from tomaarsen/hotfix/skip_crf_tests
Browse files Browse the repository at this point in the history
Temporarily remove `python-crfsuite` from CI dependencies & skip tests
  • Loading branch information
stevenbird committed Dec 22, 2022
2 parents 3c04543 + fd76cf9 commit 2e11807
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions nltk/tag/crf.py
Expand Up @@ -25,23 +25,23 @@ class CRFTagger(TaggerI):
A module for POS tagging using CRFSuite https://pypi.python.org/pypi/python-crfsuite
>>> from nltk.tag import CRFTagger
>>> ct = CRFTagger()
>>> ct = CRFTagger() # doctest: +SKIP
>>> train_data = [[('University','Noun'), ('is','Verb'), ('a','Det'), ('good','Adj'), ('place','Noun')],
... [('dog','Noun'),('eat','Verb'),('meat','Noun')]]
>>> ct.train(train_data,'model.crf.tagger')
>>> ct.tag_sents([['dog','is','good'], ['Cat','eat','meat']])
>>> ct.train(train_data,'model.crf.tagger') # doctest: +SKIP
>>> ct.tag_sents([['dog','is','good'], ['Cat','eat','meat']]) # doctest: +SKIP
[[('dog', 'Noun'), ('is', 'Verb'), ('good', 'Adj')], [('Cat', 'Noun'), ('eat', 'Verb'), ('meat', 'Noun')]]
>>> gold_sentences = [[('dog','Noun'),('is','Verb'),('good','Adj')] , [('Cat','Noun'),('eat','Verb'), ('meat','Noun')]]
>>> ct.accuracy(gold_sentences)
>>> ct.accuracy(gold_sentences) # doctest: +SKIP
1.0
Setting learned model file
>>> ct = CRFTagger()
>>> ct.set_model_file('model.crf.tagger')
>>> ct.accuracy(gold_sentences)
>>> ct = CRFTagger() # doctest: +SKIP
>>> ct.set_model_file('model.crf.tagger') # doctest: +SKIP
>>> ct.accuracy(gold_sentences) # doctest: +SKIP
1.0
"""

Expand Down
1 change: 0 additions & 1 deletion requirements-ci.txt
Expand Up @@ -4,7 +4,6 @@ matplotlib
pytest
pytest-mock
pytest-xdist[psutil]
python-crfsuite
regex
scikit-learn
tqdm
Expand Down

0 comments on commit 2e11807

Please sign in to comment.