Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-10-2022 06:46 PM
Hi,
I'm trying to add a calculated property to each of a bunch of nodes based on the 'SentText' property of that node (a BERT sentence embedding vector calculated in Python in this case).
I've found an example of apoc.periodic.iterate below (https://towardsdatascience.com/batching-transactions-in-neo4j-1001d12c9a4a) that I've modified to show something like what I'm looking for.
Is there a way to do this? How else can I do this?
CALL apoc.periodic.iterate( // first statement
"MATCH (s:Sentence)
WHERE EXISTS(s.SentText)
RETURN s, s.SentText",
// second statement
"MERGE (s)
SET s.BertVector = PythonBertFunction(s.SentText)",
// configuration
{batchSize:50000})
Thank you!
06-11-2022 04:31 AM
Interesting!
Is there a way for you to write the Bert function in Java? In that case you can build your own procedure and load into the db.
Otherwise, you may need to use the Python driver and handle the batches on your application layer.
All the sessions of the conference are now available online