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

Tagger.tag segfaults if Tagger.open is not called

Open kmike opened this issue 10 years ago • 6 comments

kmike avatar Dec 25 '15 13:12 kmike

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

Ridinstar avatar Mar 29 '16 20:03 Ridinstar

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

kmike avatar Mar 29 '16 21:03 kmike

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

Ridinstar avatar Mar 29 '16 21:03 Ridinstar

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

kmike avatar Mar 29 '16 21:03 kmike

@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.

Ridinstar avatar Mar 29 '16 22:03 Ridinstar

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)

cortadocodes avatar Mar 08 '19 09:03 cortadocodes