You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import gensim
from pyecharts import WordCloud
sentences = gensim.models.word2vec.LineSentence('segwords_m.txt')
model = gensim.models.Word2Vec(sentences, size=200)
model.save("segwords_m.model")
model = gensim.models.word2vec.Word2Vec.load("segwords_m.model")
word = model.most_similar('股票名称',topn=10)
name = []
value = []
for i in word:
name.append(i[0])
value.append(i[1])
wordcloud = WordCloud(width=1300, height=620)
wordcloud.add("", name, value, word_size_range=[20, 100])
wordcloud.render()
感谢大家,我发现词云展示有点问题,不知道什么原因?
是因为代码如下:
def wordcloudResult(request): return render(request,"wordcloudResult.html")
词云的数据需要单独计算出来吗?
@LinLidi 希望给予回复
The text was updated successfully, but these errors were encountered: