Created
November 2, 2018 16:03
-
-
Save infinite-Joy/57a2de636fc97c1a25201e41c54e4401 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open("emb/movies.emb", "r") as movies_file, driver.session() as session: | |
next(movies_file) | |
reader = csv.reader(movies_file, delimiter=" ") | |
params = [] | |
for row in reader: | |
movie_id = row[0] | |
params.append({ | |
"id": int(movie_id), | |
"embedding": [float(item) for item in row[1:]] | |
}) | |
session.run("""\ | |
UNWIND {params} AS param | |
MATCH (m:MovieId) WHERE id(m) = param.id | |
SET m.embedding = param.embedding | |
""", {"params": params}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment