scrapinghub / python-crfsuite

A python binding for crfsuite
MIT License
770 stars 222 forks source link

Tagger.tag segfaults if Tagger.open is not called #28

Open kmike opened 8 years ago

Ridinstar commented 8 years ago

I also had similar issue, I had segfault when I use tagger.tag(), I did call tagger.open(modelfile)

kmike commented 8 years ago

@Ridinstar if you did call tagger.open it is likely a different issue. Do you have an example, how to reproduce it?

Ridinstar commented 8 years ago

@kmike Thanks for replying, never mind, it's a silly mistake in formatting training data.

kmike commented 8 years ago

@Ridinstar mistake in formatting training data shouldn't cause a segfault, it is a python-crfsuite bug if it does :)

Ridinstar commented 8 years ago

@kmike I am able to reproduce that segfault if I append no data to trainer, and I use this trainer to predict the labels of a valid test sequence.

cortadocodes commented 5 years ago

Training a model with no data and trying to predict with it also seems to cause a segfault:

import pycrfsuite

MODEL_FILENAME = 'b.crfsuite'

trainer = pycrfsuite.Trainer(verbose=False)
trainer.train(MODEL_FILENAME)

tagger = pycrfsuite.Tagger()
tagger.open(MODEL_FILENAME)

# Causes segmentation fault
tagger.tag(['hello'])

The following error is produced:

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)