Here is a python script :
以下是一个PYTHON脚本:
from zeugma import TextsToSequences
test = ['I am here to stay', 'Who are you', 'Hello World']
sequencer = TextsToSequences()
embedded_sequ = sequencer.fit_transform(test)
It return this error :
它返回以下错误:
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.
How to solve this issue?
如何解决这个问题?
I try to give the same length to each element of test.
我试着给测试的每个元素赋予相同的长度。
I expected to have a list of number for the return
我本以为会有一份退货的号码清单
更多回答
More detail, I used this library : from zeugma import TextsToSequences
更详细地说,我使用了这个库:从zeugma导入TextsToSequence
优秀答案推荐
Convert it into list of words:
将其转换为单词列表:
test = [['I', 'am', 'here', 'to', 'stay'], ['Who', 'are', 'you'], ['Hello', 'World']]
sequencer = TextsToSequences()
embedded_sequ = sequencer.fit_transform(test)
更多回答
I tried it. I have this output error : ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.
我试过了。我有这样的输出错误:ValueError:使用序列设置数组元素。请求的数组在%1维后具有不均匀形状。检测到的形状为(3,)+不均匀部分。
我是一名优秀的程序员,十分优秀!