54行 sklearn中使用Tf-idf加权进行特征提取
from sklearn.feature_extraction.text import TfidfVectorizer
import jieba
import pandas as pd
#导入数据
text_list=[]
for i in range(1,6):
file_path=r'D:\源代码检测\特征提取文档\text军训心得'+str(i)+'.txt'
with open(file_path,encoding="UTF-8") as f:
text=f.read()
#使用