python-crfsuite icon indicating copy to clipboard operation
python-crfsuite copied to clipboard

Some problems with estimator

Open theasder opened this issue 6 years ago • 1 comments

Hello there, I have some problems

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-15-09b42206d68c> in <module>()
      2 print('best params:', rs.best_params_)
      3 print('best CV score:', rs.best_score_)
----> 4 print('model size: {:0.2f}M'.format(rs.best_estimator_.size_ / 1000000))

~/anaconda3/lib/python3.6/site-packages/sklearn_crfsuite/estimator.py in size_(self)
    445         Size of the CRF model, in bytes.
    446         """
--> 447         if self._info is None:
    448             return None
    449         return int(self._info.header['size'])

~/anaconda3/lib/python3.6/site-packages/sklearn_crfsuite/estimator.py in _info(self)
    497             return None
    498         if self._info_cached is None:
--> 499             self._info_cached = self.tagger_.info()
    500         return self._info_cached
    501 

pycrfsuite/_pycrfsuite.pyx in pycrfsuite._pycrfsuite.Tagger.info()

pycrfsuite/_pycrfsuite.pyx in pycrfsuite._pycrfsuite.Tagger.info()

~/anaconda3/lib/python3.6/site-packages/pycrfsuite/_dumpparser.py in feed(self, line)
     60             self.state = None
     61         else:
---> 62             getattr(self, 'parse_%s' % self.state)(line)
     63 
     64     def parse_FILEHEADER(self, line):

~/anaconda3/lib/python3.6/site-packages/pycrfsuite/_dumpparser.py in parse_ATTRIBUTES(self, line)
     72     def parse_ATTRIBUTES(self, line):
     73         m = re.match("(\d+): (.*)", line)
---> 74         self.result.attributes[m.group(2)] = m.group(1)
     75 
     76     def parse_TRANSITIONS(self, line):

AttributeError: 'NoneType' object has no attribute 'group'

Why could it happen? I used source code from your notebook for experiment.

theasder avatar May 19 '18 16:05 theasder

Did you find a solution to this problem?

aimlnerd avatar May 30 '22 13:05 aimlnerd