Closed chriswales95 closed 3 years ago
Closing this issue after having solved it after figuring it out. It was to do with my data processing. My own issue :)
Leaving this here for people to potentially help others. Review your data!
Hi @chriswales95 ,
facing the same issue. what was the error in your data processing? how did you solve it?
Thanks Yogesh
Hi @chriswales95 ,
facing the same issue. what was the error in your data processing? how did you solve it?
Thanks
Yogesh
Hi Yogesh,
I can't remember exactly how I fixed it, but I think it was the shape of the data I was giving it that was the issue.
If you're still having problems, I can double check how I was doing it beforehand and try and give some suggestions.
Let me know!
Chris
@coolsubbu I'm commenting here for future people who run into this issue since it was not explained here.
This happens if you pass CRFsuite data in a 1-D array or a list of dics.
It expects a list of lists both for your X input data and y labels. See the source code:
` def fit(self, X, y, X_dev=None, y_dev=None): """ Train a model.
Parameters
----------
X : list of lists of dicts
Feature dicts for several documents (in a python-crfsuite format).
y : list of lists of strings
Labels for several documents.
`
Hi, I'm trying to use sklearn-crfsuite for sequence labelling.
when running
crf.fit(train_data, train_targets)
on my data, I get the below stack trace:I noticed in https://github.com/TeamHG-Memex/sklearn-crfsuite/issues/20 that someone suggests using a custom scorer, but I don't seem to get past the fitting stage.
Any advice would be appreciate.
My code looks like this: