Lbl2Vec icon indicating copy to clipboard operation
Lbl2Vec copied to clipboard

ValueError: cannot compute mean with no input

Open krishnarevi opened this issue 2 years ago • 7 comments

Does this model support german keywords? There is an issue when trying to fit the model with german keywords. Can you please suggest ?

krishnarevi avatar May 31 '22 02:05 krishnarevi

Regarding this issue you can remove the epochs field or your can give epoches more than 4. This might help to solve this issue.

VMD7 avatar Aug 29 '22 10:08 VMD7

I'm also getting this error when trying to run the code from Tim's article, Unsupervised Text Classification with Lbl2Vec

adri0 avatar Nov 07 '22 15:11 adri0

anyone found the source of the error?

jarolim14 avatar Jul 07 '23 12:07 jarolim14

Same here, getting ` cannot compute mean with no input ' and no way to solve it. @krishnarevi is there any fix to this? what exactly is going on? Thanks

isaldiviagonzatti avatar Mar 09 '24 18:03 isaldiviagonzatti

Regarding this issue you can remove the epochs field or your can give epoches more than 4. This might help to solve this issue.

This does not work.

isaldiviagonzatti avatar Mar 09 '24 18:03 isaldiviagonzatti

I am also having this problem.

ValueError: cannot compute mean with no input

i can provide more information if wanted. But this is the model function

Lbl2Vec_model = Lbl2Vec(keywords_list=list(labels.keywords), tagged_documents=full_corpus['tagged_responses'][full_corpus['data_set_type'] == 'train'], label_names=list(labels.class_name), similarity_threshold=0.43, min_num_docs=5, epochs=10)

1jamesthompson1 avatar Apr 12 '24 02:04 1jamesthompson1

I am facing the same issue and after debugging I found that the problem arises here - https://github.com/sebischair/Lbl2Vec/blob/d9efdf5969c433dfea22673cec69865da4534f38/lbl2vec/lbl2vec.py#L609

I always get a warning stating that the keywords_list are unknown to the Doc2Vec model and therefore will not be used to train. Which in result provides an empty cleaned_keywords_list and an empty keyword_vectors which is passed onto the methoddoc2vec_model.dv.most_similar from Doc2Vec class, there aren't any keyword_vectors, so mean value cannot be computed.

Only option I feel at this point that makes sense (which is also mentioned in the logger warning or info) - change your keywords to words that are present in the doc2vec model or train your own doc2vec model.

shashankmc avatar Aug 29 '24 15:08 shashankmc