Sentence embeddings and graph connections in Neo4j

I interest with the topic "Visualizing context with Google’s Universal Sentence Encoder and GraphDB" with the link Visualizing Text Embeddings and Context in a Graph with Neo4j | by Utkarsh Garg | Towards Data Science

I'm wondering how to apply the pre-trained model in TensorFlow hub with neo4j.
Thank you.

This question is a bit too broad to be answerable. You might consider narrowing it a bit. Are you referring to the DAN model? There are code examples of how to use the DAN model with any input data. So the simplest answer is that if you can write a cypher query that returns a set of texts as a result, you can use it with the DAN model, assuming you have the right plumbing in place. But how to do that depends on what kind of data you have, what your graph model is, and what you're trying to accomplish with the pre-built tensorflow model, which is why it's tough to answer the question.

Hi, Mr. David Allen. Thank you for your respond.
Actually, I want to compare phrases from two documents.
My idea is to build a knowledge graph that nodes(phrases) linked if they are semantically similar.
The detailed description is as follows:

  1. The nodes are phrases from two documents.
  2. The colour of node(phrase) depend on which document it belongs to.
  3. The Google's universal sentence encoder model from TensorFlow Hub is applied to determine the similarity between two phrases. The edge label is the similarity score between the two nodes.
    Please find the example of graph attached.

If I apply Google's universal sentence encoder model in python
and get the similarity score between two phrases, then store the similarity score in csv.
Is it possible that by using neo4j, phrase is the query while the result is knowledge graph that display the query linked to the other phrase (with their similarity score)?

If yes, can you tell me what should I do to complete this task?
Thank you.