如何用序列固定数组元素?

问题描述 投票:0回答:1

遇到这个问题,但我不知道如何解决?

ValueError                   Traceback (most recent call last)
Cell In[8], line 2
      1 # Generate aggregated sentence vectors based on the word vectors for each word in the sentence
----> 2 w2v_vect = np.array([np.array([w2v_model.wv[i] for i in ls if i in w2v_model.wv.index_to_key])
      3                      for ls in X_test])

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (1115,) + inhomogeneous part.

我不知道要修改什么以及如何修改。

vectorization sequence word2vec training-data valueerror
1个回答
0
投票

@gojomo 你是如何解决这个问题的?

© www.soinside.com 2019 - 2024. All rights reserved.