chokkan / crfsuite

CRFsuite: a fast implementation of Conditional Random Fields (CRFs)
http://www.chokkan.org/software/crfsuite/
Other
641 stars 208 forks source link

Results difference between command-line CRFsuite vs Python CRFsuite #124

Open UAmsterdam opened 7 months ago

UAmsterdam commented 7 months ago

I was trying to replicate a code which was using CRFsuite (Command line version) for training a model. Below is the command:

"crfsuite learn -a pa -p c=0.1 -p type=2 -p max_iterations=100 -m model.crfsuite sample_data"

Then I was trying to replicate it using python wrapper of CRFsuite like this on same dataset:

"crf = CRF(algorithm="pa",c=0.1, max_iterations=100, pa_type=2, verbose=True) crf.fit(X_train, y_train)"

I am not getting the same results:

From the command line I am getting "Precision: 0.9491228053524161, Recall: 0.9107744092411205, F1: 0.9295527632204716"

However, from the python version I am getting:

"Precision: 0.9633401202375965, Recall: 0.7962962949557302, F1: 0.8718889038207067"

Does anyone else have also faced this challenge or know about these kind of issues?