Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikwattro/f1feb78451cc848d1064ab3bab13cc90 to your computer and use it in GitHub Desktop.
Save ikwattro/f1feb78451cc848d1064ab3bab13cc90 to your computer and use it in GitHub Desktop.
MATCH (n:VideoTranscript {path: "/Users/ikwattro/dev/_transcript/Knowledge Graph Search with Elasticsearch — L. Misquitta and A. Negro, GraphAware-k8Gu6GMbBtQ.en.vtt"})
WITH n
UNWIND range(60000, 3600000, 60000) AS i
MATCH (n)-[:HAS_CAPTION]->(c)-[:HAS_ANNOTATED_TEXT]->(at)<-[r:DESCRIBES]-(k)
WHERE c.startTimeMS > i - 60000 AND c.endTimeMS < i
WITH n, i, k, sum(r.relevance) AS score
WITH n, i, collect({keyword: k.value, score: score}) AS m
WITH n, i, reverse(apoc.coll.sortMaps(m, 'score'))[0..5] AS m
RETURN i, apoc.text.join([x in m | x.keyword], ', ') ORDER BY i ASC
╒═══════╤═════════════════════════════════════════════════════════════════════════════════════════════════════════╕
│"i"    │"apoc.text.join([x in m | x.keyword], ', ')"                                                             │
╞═══════╪═════════════════════════════════════════════════════════════════════════════════════════════════════════╡
│60000  │"relevant search, first knowledge graph, knowledge graph, chief scientist, day"                          │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│120000 │"multiple datum source, dive, case, last couple, organic form"                                           │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│180000 │"knowledge graph, various different hierarchy, enterprise network, only product, employee"               │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│240000 │"structured graph, core current, panama papers, case student, relationship"                              │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│300000 │"knowledge graph, human trafficking, criminal investigation, intelligence"                               │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│360000 │"classic problem, datum sparsity, trust network, knowledge graph, people"                                │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│420000 │"hard problem, relevant search, knowledge basis, user agnostic search, anonymous agnostic search"        │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│480000 │"law enforcement case, knowledge graph, variety, provenance, sort"                                       │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│540000 │"final datum information, relevant search capability, machine learning process, specific user experience,│
│       │ search engine"                                                                                          │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│600000 │"different dimension, real architecture, high level set, end user, different element"                    │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│660000 │"same query, relevant search move, user modeling, user profile, information retrieval"                   │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│720000 │"feedback loop, relevant search, context information, entire implementation, specific goal"              │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│780000 │"term, high quantity datum, information structure, right approach, relevant search"                      │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│840000 │"information extraction, unstructured datum, related, context representation, direct representation"     │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│900000 │"knowledge graph, recommendation engine, basic set, ontology structure, relationship"                    │
├───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────┤
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment