NorskRegnesentral / skweak

skweak: A software toolkit for weak supervision applied to NLP tasks
MIT License
917 stars 71 forks source link

Error: Cannot apply along axis 0, when applying hmm.fit #40

Closed AlineBornschein closed 2 years ago

AlineBornschein commented 2 years ago

I'm getting this error when running fit and aggregate. It seems to be related to documents without any annotations by the labelling functions. When tying it with the documents in my data set that have annotations, it works fine. However, when running it on specific ones where the labelling functions did not detect anything, it throws this error. Is this a known issue and is there any way to fix this? Thanks! `docs = list(LF1.pipe(train_data)) docs = list(LF2.pipe(docs)) docs = list(LF3.pipe(docs)) docs = list(LF4.pipe(docs)) docs = list(LF5.pipe(train)) ner_model = skweak.spacy.ModelAnnotator("spacy", "en_core_web_sm") docs = list(ner_model.pipe(docs))

hmm = skweak.aggregation.HMM("hmm",["A", "NOT_A"], sequence_labelling=False) hmm.fit_and_aggregate(docs)``

image

AlineBornschein commented 2 years ago

This error has been resolved after downgrading hmmlearn to 0.2.6

plison commented 2 years ago

Let me know if you still experience any issue with the new version that was just released