ZBLOG

ValueError: The constructor now takes in a list of Node objects. Since you are passing in a list of Document objects, please use `from_documents` instead.

This error message indicates that you are trying to create a new object using the wrong type of input. The constructor now requires a list of Node objects, but you are passing in a list of Document objects.

To fix this issue, you should use the from_documents method instead of the constructor. This method is used to create an object from a list of Document objects.

Here’s an example:

from gensim import corpora

documents = ["This is the first document", "This is the second document", "And this is the third one"]

# Create a list of Document objects
doc_list = [corpora.Document(doc) for doc in documents]

# Use from_documents method to create a new object
my_corpus = corpora.Dictionary.from_documents(doc_list)

In this example, we create a list of Document objects called doc_list, and then use the from_documents method to create a new object called my_corpus.

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=716

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?