Export
[ ]
Setup: Create Sample Knowledge Base
Let's populate our knowledge graph with some data to search:
[16]
ā Created 24 triples for our tech knowledge base!
Basic Semantic Search
Search using natural language - Neode understands the meaning behind your query:
[17]
š Query: 'Who founded Apple?' -------------------------------------------------- š Matching Entities: Apple Inc (similarity: 0.6434) Steve Jobs (similarity: 0.4919) Google (similarity: 0.4489) Microsoft (similarity: 0.4449) Bill Gates (similarity: 0.3149) š Matching Triples: Apple Inc ā founded_by ā Steve Jobs (similarity: 0.7714) Apple Inc ā founded_by ā Steve Wozniak (similarity: 0.7369) Apple Inc ā founded_in ā 1976 (similarity: 0.6492) Apple Inc ā produces ā iPhone (similarity: 0.5513) Steve Jobs ā is_a ā entrepreneur (similarity: 0.5216)
[19]
š Query: 'What products does Apple make?' -------------------------------------------------- Apple Inc ā produces ā iPhone Apple Inc ā produces ā MacBook Apple Inc ā industry ā consumer electronics š Query: 'Where is Microsoft located?' -------------------------------------------------- Microsoft ā headquartered_in ā Redmond, Washington Microsoft ā founded_in ā 1975 Microsoft ā founded_by ā Paul Allen š Query: 'Tell me about Bill Gates' -------------------------------------------------- Bill Gates ā is_a ā entrepreneur Bill Gates ā is_a ā philanthropist Microsoft ā founded_by ā Bill Gates š Query: 'Which founders went to Stanford?' -------------------------------------------------- Larry Page ā studied_at ā Stanford University Sergey Brin ā studied_at ā Stanford University Google ā founded_by ā Sergey Brin š Query: 'Companies in California' -------------------------------------------------- Google ā parent_company ā Alphabet Inc Google ā headquartered_in ā Mountain View, California Apple Inc ā headquartered_in ā Cupertino, California
Semantic Search with GET Method
You can also use the GET endpoint for simpler queries:
[20]
š Query: 'technology entrepreneurs' -------------------------------------------------- š Matching Entities: Bill Gates (similarity: 0.5770) Steve Jobs (similarity: 0.5346) Larry Page (similarity: 0.4131) Google (similarity: 0.3645) Sergey Brin (similarity: 0.3637) š Matching Triples: Bill Gates ā is_a ā entrepreneur Steve Jobs ā is_a ā entrepreneur Google ā founded_by ā Larry Page Google ā founded_by ā Sergey Brin Bill Gates ā is_a ā philanthropist Microsoft ā founded_by ā Bill Gates Google ā founded_in ā 1998 Larry Page ā studied_at ā Stanford University Microsoft ā founded_by ā Paul Allen Sergey Brin ā studied_at ā Stanford University
Building a Simple Q&A Function
[21]
ā When was Google founded? Based on the knowledge graph: ⢠Google founded in 1998 ⢠Google founded by Sergey Brin ⢠Google founded by Larry Page ⢠Microsoft founded in 1975 ⢠Google headquartered in Mountain View, California ā What does Microsoft make? Based on the knowledge graph: ⢠Microsoft produces Windows ⢠Microsoft founded by Bill Gates ⢠Microsoft founded in 1975 ⢠Microsoft headquartered in Redmond, Washington ⢠Microsoft founded by Paul Allen ā Who are famous entrepreneurs? Based on the knowledge graph: ⢠Steve Jobs is a entrepreneur ⢠Bill Gates is a entrepreneur ⢠Bill Gates is a philanthropist ⢠Google founded by Sergey Brin ⢠Google founded by Larry Page
Combining Search with Analysis
[22]
š Search Results Analysis: Total results: 20 Unique subjects: ['Google', 'Microsoft', 'Steve Jobs', 'Bill Gates', 'Apple Inc', 'Sergey Brin', 'Larry Page'] Relationship types found: predicate founded_by 6 founded_in 3 is_a 3 produces 3 studied_at 2 parent_company 1 industry 1 headquartered_in 1 Name: count, dtype: int64
Next Steps
- 04_ai_triple_generation.ipynb - Automatically generate triples from text
- 05_graphs_and_entities.ipynb - Organize knowledge into separate graphs