TfidfVectorizer 的替代品

Alternative to TfidfVectorizer

sklearn.feature_extraction.text 模块的TfidfVectorizer 功能是否有替代方案?我听说过 fastText 和 GloVe,但找不到如何使用它来矢量化文本的很好的解释。

编辑: 基本上我有一个叫做旁白的功能,它由英文句子组成。为了将其输入到任何 ML 算法中,我必须将其转换为数字矩阵表示。 TfIdf 是一种方式。还有其他方法可以尝试吗? (可能在也可能不在 sklearn 下)

您正在寻找的是所谓的文本嵌入,例如 this. Essentially for your naration feature, you are looking to turn a sequence into vectors, hence seq_to_vec. TfIdf is just one of the simplest ways of doing this, which yields a sparse (many more components are =0, than not). I suggest you look here 是一个很好的起点。