Trouble opening info after loading the data from model

Đang mở
#14 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
machine-learning

Hướng nghiên cứu

Start by reading pycrfsuite/_dumpparser.py, especially parse_LABELS, and trace how Tagger.info() parses the model dump. Reproduce the traceback with the reported tagger.open('crf') and tagger.info() calls; done means identifying why the label line fails to match and confirming the parser handles the affected model output.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hello,

I think that the library is great but I have a problem to open the info.
I have already trained the CRF and I want to open the model to see the features.
I do:

tagger = pycrfsuite.Tagger()
tagger.open('crf')
info = tagger.info()

And I got the following traceback:

Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/helpers/pydev/pydevd.py", line 1733, in <module>
    debugger.run(setup['file'], None, None)
  File "/Applications/PyCharm CE.app/helpers/pydev/pydevd.py", line 1226, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Users/alexisbenoist/Documents/python/papyrus/learn.py", line 197, in <module>
    learn()
  File "/Users/alexisbenoist/Documents/python/papyrus/learn.py", line 169, in learn
    crf.print_most_common_features()
  File "/Users/alexisbenoist/Documents/python/papyrus/extraction/extractor.py", line 219, in print_most_common_features
    for (attr, label), weight in self.most_common_features.most_common(nb):
  File "/Users/alexisbenoist/Documents/python/papyrus/extraction/extractor.py", line 215, in most_common_features
    info = tagger.info()
  File "pycrfsuite/_pycrfsuite.pyx", line 704, in pycrfsuite._pycrfsuite.Tagger.info (pycrfsuite/_pycrfsuite.cpp:8649)
  File "pycrfsuite/_pycrfsuite.pyx", line 706, in pycrfsuite._pycrfsuite.Tagger.info (pycrfsuite/_pycrfsuite.cpp:8590)
  File "/Users/alexisbenoist/Documents/python/papyrus/env/lib/python2.7/site-packages/pycrfsuite/_dumpparser.py", line 61, in feed
    getattr(self, 'parse_%s' % self.state)(line)
  File "/Users/alexisbenoist/Documents/python/papyrus/env/lib/python2.7/site-packages/pycrfsuite/_dumpparser.py", line 69, in parse_LABELS
    self.result.labels[m.group(2)] = m.group(1)
AttributeError: 'NoneType' object has no attribute 'group'

I'm on python 2.7 on a mac.

Do you guys have any on what I'm doing wrong?

Any input is welcome.
Thanks,

Alexis.

Ngôn ngữ chính
Python
Star
774
Fork
223
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của scrapinghub/python-crfsuite

Tất cả issue của scrapinghub/python-crfsuite

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.