Skip to content

Commit

Permalink
Temporarily remove python-crfsuite from CI dependencies
Browse files Browse the repository at this point in the history
As it fails on Python 3.11
Also skip all CRF doctests
  • Loading branch information
tomaarsen committed Dec 22, 2022
1 parent 8588483 commit fd76cf9
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 fd76cf9

Please sign in to comment.