Python 3.x 如何将ngrams的LIT转换为逻辑回归可接受的表示,如转换为向量?

Python 3.x 如何将ngrams的LIT转换为逻辑回归可接受的表示,如转换为向量?,python-3.x,logistic-regression,n-gram,countvectorizer,Python 3.x,Logistic Regression,N Gram,Countvectorizer,我有一个数据集,包括数据集中每个句子的ngrams列表,如下图所示,以及每个句子的标记: n-grams=[['thats', 'just', 'great', 'thats just', 'just great', 'thats just great'], ['i', 'dont', 'thats', 'subscribe', 'just', 'to', 'either', 'i dont', 'dont thats', 'thats subscribe', 'subscrib

我有一个数据集,包括数据集中每个句子的ngrams列表,如下图所示,以及每个句子的标记:

n-grams=[['thats', 'just', 'great', 'thats just', 'just great', 'thats just great'], 
       ['i', 'dont', 'thats', 'subscribe', 'just', 'to', 'either', 'i dont', 'dont thats', 'thats subscribe', 'subscribe just', 'just to', 'to either', 'i dont thats', 'dont thats subscribe', 'thats subscribe just'], 
       ['what', 'is', 'that', 'when', 'you', 'do', 'just']]

act_tags=tags['statement','statement','Wh_Question']
我想在n-gram上应用逻辑回归作为特征,输出作为act标记。如何将n-gram的特征输入转换为逻辑回归可接受的向量化形式