Git Product home page Git Product logo

neo4j_streamlit's Introduction

neo4j_streamlit

Written by: Dr. Clair J. Sullivan, Data Science Advocate, Neo4j

Twitter: @CJLovesData1

Last updated: 2021-06-10

Introduction

The purpose of this code is to demonstrate how to create a Streamlit dashboard to be used for the visualization of embeddings created by the Graph Data Science library in Neo4j. This will hopefully be useful for developing an intuitive feel for these embeddings and how the different hyperparameters impact the overall results.

For more information on graph embeddings, you can read my blog post on Getting Started with Graph Embeddings in Neo4j in Towards Data Science (written in May, 2021).

How to get started

  1. Create a Neo4j Sandbox
  • Select "Launch a Free Instance"
  • Select "New Project"
  • Choose "Graph Data Science": This will create an instance pre-populated with the Game of Thrones graph we will use to get started
  • Choose the drop-down on the right of the instance and select "Connection details"
  • Record the Bolt URL and Password
  1. Build the Streamlit container
  • Edit the Dockerfile to include the Bolt URL and password from the previous step
  • From the root directory of this repo, type docker build -t neo_stream .
  • Once built, type docker run -p 8501:8501 -v $PWD/src:/examples neo_stream
  1. Using a browser, navigate to the provided IP address
  • This typically will be something like http://172.17.0.2:8501
  1. In the side panel, provide a name of the in-memory graph to be created and click "Create in-memory graph"
  2. Have fun with the functionality in the main area of the dashboard! How well can you tune the hyperparameters to get as much clustering separation between the living (blue) and the dead (red) characters???

Note: If you would like, you can navigate to https://bolt.URL.address:7474 and you can interact with the graph directly via Cypher.

Major caveats!!!

  1. This is very much a work in progress! As such, there are only two types of graph embeddings included (FastRP and node2vec) and not all of the hyperparameters have been added yet. Be sure to watch for future modifications and regularly pull the main branch of this repo to keep with the current version.
  2. The in-memory graph that is created is only the undirected, monopartite graph (Person)-[:INTERACTS]-(Person). Future versions of this code will allow you to create additional graphs.
  3. This is a very small graph! It only has about 2600 nodes and not quite 17,000 relationships. And we make that even smaller by limiting the nodes and relationships as described above. Based on these facts, we do not expect the quality of the embeddings to be that great. In future work, we will use a larger graph and discuss how to optimize embeddings.

neo4j_streamlit's People

Contributors

cj2001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

neo4j_streamlit's Issues

No response from Streamlit

Hi CJ, I am following your post and get to the point of running the docker image:

$ docker run -p 8501:8501 -v $PWD/src:/examples neo_stream
2021-11-28 22:57:42.325 override steps (5) and chunk_size (512) as content does not fit (14 byte(s) given) parameters.
2021-11-28 22:57:42.330 Trying to detect encoding from a tiny portion of (14) byte(s).
2021-11-28 22:57:42.363 ascii passed initial chaos probing. Mean measured chaos is 0.000000 %
2021-11-28 22:57:42.369 ascii should target any language(s) of ['Latin Based']
2021-11-28 22:57:42.369 ascii is most likely the one. Stopping the process.

  You can now view your Streamlit app in your browser.

  Network URL: http://172.17.0.2:8501

However, I get no response at the above URL. Any thoughts?
PS: I cloned the repo to WSL Ubuntu.

Thanks John

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.