dictionary = corpora.Dictionary(sentences)
corpus = [dictionary.doc2bow(text) for text in sentences] 获取语料库,例如:(0,1),(1,5),(3,1) ...我想要的语料库如下:(word_1,1),(word_2,5),(word_3,1) ... 所以我想要在语料库中获取单词而不是id单词。有没有人能告诉我怎样才能将这样的语料库保存为excel文件?
我有一个数据集(客户审查语料库)如下所示:[["I like the product", "5"],["the product is poor", "2.5"],["it isan okay product", "3"],["the quality is poor", "1"],["color is great", "3.5"]]
第