ElliotTheRobot / LILACS-mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform - LILACS Fork
https://mycroft.ai
GNU General Public License v3.0
4 stars 1 forks source link

Question Parser #21

Closed JarbasAI closed 7 years ago

JarbasAI commented 7 years ago

We need a robust questions parser, it must take any utterance and decide what is being asked

different crawl strategies answer different questions #12 #15

this is one of the most important steps for this to work well in the mycroft infrastructure

possible ways to go:

JarbasAI commented 7 years ago

http://www.clips.ua.ac.be/pages/pattern-en <- this seems the most simple to use

The following example shows the parse tree for the sentence "The cat sat on the mat.":

NP [(u'the', u'DT'), (u'cat', u'NN')]
VP [(u'sat', u'VBD')]
PP [(u'on', u'IN')]
NP [(u'the', 'DT), (u'mat', u'NN')] 

we should be able to extract start_node and end_node from this, checking for key words "why" , "what", and the sorts off we can decide what question is being asked and what cawler to use

JarbasAI commented 7 years ago

https://github.com/ProjetPP/PPP-QuestionParsing-Grammatical <- this is maybe too much, but definitely interesting and relevant

JarbasAI commented 7 years ago

a very primitive question parser is in place, currently outputs

Question: how to kill a chicken
center_node: kill
synonims: {u'kill': u'murder'}
target_node: chicken
parents: [u'Species', u'Eukaryote', u'Animal', u'Bird']
question_type: how

Question: what is a frog
center_node: frog
synonims: {}
target_node: 
parents: []
question_type: what

Question: why are humans living beings
center_node: humans
synonims: {u'living beings': u'jiva'}
target_node: living beings
parents: []
question_type: why

Question: give examples of animals
center_node: animals
synonims: {}
target_node: 
parents: [u'Species', u'Eukaryote', u'Animal']
question_type: give examples
JarbasAI commented 7 years ago

added relevant nodes field and made parents a dict

Question: how to kill animals ( a cow ) and make meat
question_type: how
center_node: kill
target_node: animals
parents: {u'animals': [u'Species', u'Eukaryote', u'Animal'], u'cow': [u'Species', u'Eukaryote', u'Animal', u'Mammal']}
relevant_nodes: [u'meat', u'cow']
synonims: {u'kill': u'murder', u'cow': u'cattle'}

target node selection needs refining