Commit 94aef5ab authored by 赵威's avatar 赵威

update data ids

parent bb928ba1
...@@ -78,7 +78,6 @@ def clicked_tractate_ids_item2vec(): ...@@ -78,7 +78,6 @@ def clicked_tractate_ids_item2vec():
click_ids = [] click_ids = []
with open(os.path.join(data_dir, "click_tractate_ids.csv"), "r") as f: with open(os.path.join(data_dir, "click_tractate_ids.csv"), "r") as f:
data = f.readlines() data = f.readlines()
data = data[:100]
for i in data: for i in data:
tmp = i.split("|") tmp = i.split("|")
# device_id = tmp[0] # device_id = tmp[0]
...@@ -87,7 +86,7 @@ def clicked_tractate_ids_item2vec(): ...@@ -87,7 +86,7 @@ def clicked_tractate_ids_item2vec():
model = Word2Vec(click_ids, hs=0, min_count=3, workers=multiprocessing.cpu_count(), iter=10) model = Word2Vec(click_ids, hs=0, min_count=3, workers=multiprocessing.cpu_count(), iter=10)
print(model) print(model)
print(len(click_ids)) print(len(click_ids))
for id in ["396948", "395803", "394988"]: for id in ["373744", "268517", "512"]:
print(model.wv.most_similar(id, topn=5)) print(model.wv.most_similar(id, topn=5))
return model return model
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment