#coding=UTF-8
import re
import time
import csv
import sys
import os
import gensim.models.word2vec as w2v
import jieba
import glob
def loadPoorEnt(path2 = 'G:/project/sentimation_analysis/data/stopwords.csv'):
csvfile = open(path2,encoding='UTF-8')
stopwords = [line.strip() for line in csvfile.readlines()]
return stopwords
def get_all_content():
#abel_dir = [path + x for x in os.listdir(path) if os.path.isdir(path + x)]
all_files = glob.glob(r'D:/GFZQ/GFZQ/xuesu2018/xuesu/*.csv')
return all_files
def get_wenben(path):
csvfile = open(path,'r',encoding='UTF-8')
reader = csv.reader(csvfile)
return reader
def set_ourdict(all_files,length):
all_file = []
for i in range(length):
print ("正在解析第%d家公司" %i)
file_path = all_files[i]
wenben = get_wenben(file_path)
all_file.app
基于Word2Vec 的相似度计算
最新推荐文章于 2024-05-24 20:53:15 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)