See discussions, stats, and author profiles for this publication at: [Link]
net/publication/322857914
Graph NLU: Natural Language Understanding with
Python and Neo4j
Presentation · July 2017
DOI: 10.13140/RG.2.2.18441.34407
CITATIONS READS
0 646
1 author:
Dan Kondratyuk
Google Inc.
20 PUBLICATIONS 86 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
Improving Virtual Assistant Memory View project
Deep Learning View project
All content following this page was uploaded by Dan Kondratyuk on 01 February 2018.
The user has requested enhancement of the downloaded file.
Graph NLU
Natural Language Understanding
with Python and Neo4j
Dan Kondratyuk July 2017
Summary
● About me
● Research Question
● Experiences with Neo4j
● Natural Language Implementation
About Me
About me
● Researcher & Developer
● Recently graduated with a Bachelor’s in Computer Science
○ Boise State University
● Member of Speech, Language, and Interactive Machines (SLIM)
○ Interaction ∩ Computation
About me
● Full Stack Developer
● Hello Augi
○ A personal assistant that remembers when you forget
○ [Link]
Research Question
Intelligent Personal Assistants
Intelligent Personal Assistants of today are rapidly transforming how
humans interact with machines.
Memory Problems
Personal assistants behave like amnesiacs
● Their memory is inflexible, or nonexistent
● Interactivity is limited to predefined knowledge
and known tasks
A Graph-Based Approach
How could interaction be stored in memory?
How can that information be leveraged for
further use?
Real world information is highly relational
Goals
● Dynamic
● Interpretable
Experiences with Neo4j
Neo4j + Natural Language Understanding
M
Neo4j + Natural Language Understanding
M
Neo4j + Natural Language Understanding
● Persistent storage that represents the problem domain
○ Excellent for ad-hoc relationships
○ Very flexible
● Intuitive syntax
Neo4j + Natural Language Understanding
● Efficient querying capabilities
● Future
○ Real-time synchronization
○ Event triggers
○ Prefetch
Natural Language
Implementation
Use Case: Natural Language Database
1. Statement → update knowledge John
e
nam
“John's email is type: statement
name: John person em
john@[Link]” ail
email: john@[Link]
john@[Link]
Use Case: Natural Language Database
1. Statement → update knowledge John
e
nam
“John's email is type: statement
name: John person em
john@[Link]” ail
email: john@[Link]
john@[Link]
2. Question → retrieve results
“What is John's type: question email
name: John person john@[Link]
email again?” ask: email
Use Case: Natural Language Database
1. Statement → update knowledge John
e
nam
“John's email is type: statement
name: John person em
john@[Link]” ail
email: john@[Link]
john@[Link]
2. Question → retrieve results
“What is John's type: question email
name: John person john@[Link]
email again?” ask: email
“john@[Link]” answer: john@[Link]
Corpus: Facebook bAbI Tasks QA (1-20)
Steps Task 1
1. Tokenize and POS tag to produce 1 John travelled to the hallway.
(subject, relation, object) triple 2 Mary journeyed to the bathroom.
3 Where is John? hallway 1
2. Merge statement triples into a single
4 Daniel went back to the bathroom.
graph 5 John moved to the bedroom.
3. Answer each question using the graph, 6 Where is Mary? bathroom 2
compute accuracy
Results
● 100% accuracy for finding where a person is (simple data, no surprise)
● Allows for more complicated questions
○ What rooms has a person been in?
○ How many times has a person changed rooms?
○ How many times has a room been visited?
Future: use entity extraction to fill a frame, then merge with the database
NLU + Neo4j = Promising
Extra Slides
Mary
Approach: bAbI Tasks went moved moved
● A graph of syntax over a
sequence of statements kitchen garden bedroom
● Semantics are derived from
traversals over the graph moved
went went
John
Dialogue Systems
Further Reading
● Siri shortcomings. [Link]
● Why Graph Databases? [Link]
● Robinson, Ian, Jim Webber, and Emil Eifrem. Graph databases: new
opportunities for connected data. O'Reilly Media, Inc., 2015.
● Lison, Pierre. Structured probabilistic modelling for dialogue
management. Diss. University of Oslo, 2013. Chapter 2.
● Quepy natural language database [Link]
View publication stats