当前位置: 首页 纪录 HyperProjection舞“排球少年!!顶端的风景”幕后纪录
手机观看

HyperProjection舞“排球少年!!顶端的风景”幕后纪录 (2016)

2016/日本/ 剧情

HD高清

剧情简介

") # 2. 训练词向量 all_words = data.get_all_words() # 用所有的数据集来训练词向量,而不是只用训练集。 w2v = Word2Vec([all_words], sg=1, size=vector_size, negative=5, iter=5, window=5) vector = [] for w in all_words: vector.append(w2v.wv[w]) # 3. 将无子集的电影删除。删除后同步更新全部的all_movies、all_words、all_movies_to_clean print("电影大集合的数量", len(all_movies)) all_movies = data.remove_no_subset(all_movies) print("删除子集后的电影大集合的数量", len(all_movies)) for i in range(len(all_movies)): if not all_words[i] in all_movies: all_movies = None all_words = None all_movies_to_clean = None vector = None break # 4. 将影评中的影评词语转化成词向量 review_words = pd.read_csv("stage3Datasets/" predictionId ".csv") review_words = review_words["review_words"].values review_vectors = [] for w in review_words: try: print(w) review_vectors.append(w2v.wv[w]) except: continue # 5. 计算影评中的单词平均向量,即唯一向量 review_sum = 0 for v in review_vectors: review_sum = v review_vector = review_sum/len(review_vectors) # 6. 将所有影片通过平均向量的相似度进行排序 sim = [] for v in vector: sim.append(cosine_similarity(review_vector.reshape(-1, 1), v.reshape(-1, 1))) sim = np.array(sim) print("#"*80) print(sim) print(type(sim)) print("#"*80) print(sim.shape) sim = sim.reshape(-1, 1) target_index = np.argsort(sim, axis=0)[::-1]

本站所有视频和图片均来自互联网收集而来,本网站只提供web页面服务,并不提供资源存储,也不参与录制、上传
若本站收录的节目无意侵犯了贵司版权,请发邮件至123456@test.cn (我们会在3个工作日内删除侵权内容,谢谢。)

Copyright © 2019 火豆电影网 icp123