Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neo4j-graph-examples/recommendations
Neo4j Graph Example Movies Recommendation
https://github.com/neo4j-graph-examples/recommendations
algorithms cypher dataset example-data graphdb movie-data neo4j neo4j-approved neo4j-auradb-approved neo4j-auradb-dev-approved recommendations
Last synced: 6 days ago
JSON representation
Neo4j Graph Example Movies Recommendation
- Host: GitHub
- URL: https://github.com/neo4j-graph-examples/recommendations
- Owner: neo4j-graph-examples
- Created: 2020-01-31T15:34:04.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-25T09:07:05.000Z (3 months ago)
- Last Synced: 2025-01-08T18:07:37.045Z (13 days ago)
- Topics: algorithms, cypher, dataset, example-data, graphdb, movie-data, neo4j, neo4j-approved, neo4j-auradb-approved, neo4j-auradb-dev-approved, recommendations
- Language: JavaScript
- Homepage: https://sandbox.neo4j.com?usecase=recommendations
- Size: 119 MB
- Stars: 63
- Watchers: 3
- Forks: 33
- Open Issues: 39
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
:name: recommendations
:long-name: Recommendations
:description: Generate personalized real-time recommendations using a dataset of movie reviews
:icon: documentation/img/icon-movie.svg
:tags: example-data,dataset,movie-data,recommendations,cypher,algorithms
:author: William Lyon, updated for GDS 2 by Clair Sullivan
:demodb: true
:data: false
:use-load-script: false
:use-dump-file: data/recommendations-40.dump
:zip-file: false
:use-plugin: false
:target-db-version: 4.0
:bloom-perspective: bloom/recommendations.bloom-perspective
:guide: documentation/recommendations.neo4j-browser-guide
:rendered-guide: https://guides.neo4j.com/sandbox/{name}/index.html
:model: documentation/img/model.png
:example: documentation/img/example.png
:nodes: 28863
:relationships: 166261:todo: false
image::{icon}[width=100]== {long-name} Graph Example
Description: _{description}_
ifeval::[{todo} != false]
To Do: {todo}
endif::[]Nodes {nodes} Relationships {relationships}
.Model
image::{model}[].Example
image::{example}[width=600].Example Query:
[source,cypher,role=query-example,param-name=movie,param-value="Crimson Tide",result-column=recommendation,expected-result="Phantom of the Opera, The"]
----
MATCH (m:Movie {title:$movie})<-[:RATED]-(u:User)-[:RATED]->(rec:Movie)
RETURN distinct rec.title AS recommendation LIMIT 20
----=== Setup
This is for Neo4j version: {target-db-version}
ifeval::[{use-plugin} != false]
Required plugins: {use-plugin}
endif::[]ifeval::[{demodb} != false]
The database is also available on https://demo.neo4jlabs.com:7473Username "{name}", password: "{name}", database: "{name}"
endif::[]Rendered guide available via: `:play {rendered-guide}`
Unrendered guide: link:{guide}[]
Load graph data via the following:
ifeval::[{data} != false]
==== Data files: `{data}`Import flat files (csv, json, etc) using Cypher's https://neo4j.com/docs/cypher-manual/current/clauses/load-csv/[`LOAD CSV`], https://neo4j.com/labs/apoc/[APOC library], or https://neo4j.com/developer/data-import/[other methods].
endif::[]==== Dump file: `data/recommendations-embeddings-50.dump`
The file was dumped from Neo4j 5.13.
It is based on `recommendations-50.dump`, enriched with embeddings provided from https://data.neo4j.com/rec-embed/README.html on `Movie` nodes, under the property `embedding`.
Embeddings are 1536-vectors generated with OpenAI's model `text-embedding-ada-002`.
The dump does *not* contain a vector index.ifeval::[{use-dump-file} != false]
==== Dump file: `{use-dump-file}`* Drop the file into the `Files` section of a project in Neo4j Desktop. Then choose the option to `Create new DBMS from dump` option from the file options.
* Use the neo4j-admin tool to load data from the command line with the command below.
[source,shell,subs=attributes]
----
bin/neo4j-admin load --from {use-dump-file} [--database "database"]
----* Upload the dump file to Neo4j Aura via https://console.neo4j.io/#import-instructions
endif::[]
ifeval::[{use-load-script} != false]
==== Data load script: `{use-load-script}`[source,shell,subs=attributes]
----
bin/cypher-shell -u neo4j -p "password" -f {use-load-script} [-d "database"]
----Or import in Neo4j Browser by dragging or pasting the content of {use-load-script}.
endif::[]ifeval::[{zip-file} != false]
==== Zip fileDownload the zip file link:{repo}/raw/master/{name}.zip[{name}.zip] and add it as "project from file" to https://neo4j.com/developer/neo4j-desktop[Neo4j Desktop^].
endif::[]=== Code Examples
* link:code/javascript/example.js[JavaScript]
* link:code/java/Example.java[Java]
* link:code/csharp/Example.cs[C#]
* link:code/python/example.py[Python]
* link:code/go/example.go[Go]=== GraphQL API
See link:graphql[`/graphql` directory] for Node.js GraphQL API server example using link:https://www.npmjs.com/package/@neo4j/graphql[`@neo4j/graphql`]
=== Feedback
Feel free to submit issues or pull requests for improvement on this repository.