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

Wolfram Alpha - Backend #29

Closed JarbasAI closed 7 years ago

JarbasAI commented 7 years ago

with our achitecture it makes more sense to have wolphram alpha as a backend than a skill, refactoring wolfram alpha skill into backend is needed

a wolfram backend is in place that mimics wolfram alpha skill (without using mycoft api yet)

using the question parser we can get a few more nodes

question: what is the meaning of life?
answer: Answer to the Ultimate Question of Life, the Universe, and Everything is 42, (according to the book The Hitchhiker's Guide to the Galaxy, by Douglas Adams)
question_type: what
center_node: life
target_node: 
parents: {u'douglas adams': [u'agent', u'person', u'artist', u'writer']}
relevant_nodes: [u'life', u'universe', u'douglas adams', u'ultimate question', u'hitchhiker', u'answer', u'guide']
synonims: {u'answer': u"phrases from the hitchhiker's guide to the galaxy", u'hitchhiker': u'hitchhiking', u'guide': u'guide book', u'ultimate question': u"phrases from the hitchhiker's guide to the galaxy"}

question: when will the world end?
answer: time until the end of the world is 5 billion years, (The world will effectively end 5 billion years from now when the Sun becomes a red giant. As a red giant, the Sun will lose roughly 30% of its mass and (without tidal effects) the Earth will move to an orbit 1.7 AU from the Sun when the star reaches its maximum radius. Therefore, the planet is expected to escape envelopment by the expanded Sun's sparse outer atmosphere, though most, if not all, remaining life will be destroyed because of the Sun's increased luminosity. However, a more recent simulation indicates that Earth's orbit will decay due to tidal effects and drag, causing it to enter the red giant Sun's atmosphere and be destroyed.)
question_type: when
center_node: 
target_node: 
parents: {u'earth': [u'celestialbody', u'planet']}
relevant_nodes: [u'atmosphere', u'move', u'reaches', u'maximum', u'radius', u'escape', u'earth', u'red giant', u'decay', u'sun', u'destroyed', u'causing', u'envelopment', u'outer atmosphere', u'life', u'star', u'enter', u'expected', u'drag', u'luminosity', u'tidal effects', u'orbit', u'simulation', u'planet', u'mass', u'time', u'au']
synonims: {u'atmosphere': u'stellar atmosphere', u'tidal effects': u'tidal force', u'decay': u'radioactive decay', u'luminosity': u'solar luminosity', u'move': u'bird migration', u'maximum': u'maxima and minima', u'reaches': u'sailing', u'simulation': u'computer simulation', u'destroyed': u'slighting', u'expected': u'expected value', u'drag': u'drag (physics)', u'causing': u'causality', u'radius': u'solar radius', u'escape': u'escape velocity', u'envelopment': u'envelope', u'au': u'astronomical unit', u'outer atmosphere': u'stellar atmosphere', u'enter': u'atmospheric entry', u'mass': u'solar mass'}

question: do aliens exist?
answer: Drake equation : number of communicating civilizations in the Milky Way, 10
question_type: unknown
center_node: aliens
target_node: exist
parents: {}
relevant_nodes: [u'milky', u'communicating', u'civilizations', u'drake equation', u'number']
synonims: {u'aliens': u'extraterrestrial life', u'exist': u'existence', u'communicating': u'communication'}
JarbasAI commented 7 years ago

single word queries also produce useful output


question: mars
answer: Mars (planet) : current distance from Earth, 2.328 au, 19.36 light minutes, average distance from Earth, 1.7 au, 14.1 light minutes, current distance from Sun, 1.535 au, 12.77 light minutes, largest distance from orbit center, 2.4922873×10^8 km, 1.66599116 au, nearest distance from orbit center, 2.06644545×10^8 km, 1.38133346 au, orbital period, 1.8808476 a
question_type: unknown
center_node: mars
target_node: 
parents: {u'earth': [u'celestialbody', u'planet'], u'mars': [u'celestialbody', u'planet']}
relevant_nodes: [u'orbital period', u'light', u'average', u'orbit', u'planet', u'au', u'mars', u'earth', u'sun']
synonims: {u'planet': u'extrasolar planet', u'average': u'arithmetic mean', u'au': u'astronomical unit'}
question: frog
answer: frogs, toads... (animals) is Anura
question_type: unknown
center_node: frog
target_node: 
parents: {u'toads': [u'species', u'eukaryote', u'animal', u'amphibian'], u'animals': [u'species', u'eukaryote', u'animal']}
relevant_nodes: [u'frogs', u'anura', u'toads', u'animals']
synonims: {u'anura': u'frog'}
question: cat
answer: domestic cat (animal) is Felis catus
question_type: unknown
center_node: cat
target_node: 
parents: {u'domestic cat': [u'species', u'eukaryote', u'animal', u'mammal'], u'animal': [u'species', u'eukaryote', u'animal'], u'felis catus': [u'species', u'eukaryote', u'animal', u'mammal'], u'cat': [u'species', u'eukaryote', u'animal', u'mammal']}
relevant_nodes: [u'domestic cat', u'felis catus', u'animal']
synonims: {}

perhaps we can parse the sentence and add whateve comes after is as a parent