Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problems with estimator #85

Open
theasder opened this issue May 19, 2018 · 1 comment
Open

Some problems with estimator #85

theasder opened this issue May 19, 2018 · 1 comment

Comments

@theasder
Copy link

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.

@aimlnerd
Copy link

Did you find a solution to this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants