Author Topic: Siri like functionality i.e. ask your computer any question  (Read 19356 times)

0 Members and 5 Guests are viewing this topic.

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Siri like functionality i.e. ask your computer any question
« on: April 09, 2012, 07:29:35 AM »
Hi guys,

This is pretty much the only thing missing for me now.  I am driving my friends insane with either jealousy or boredom depending how techy they are because I can't stop telling them how cool it is to be able to switch my heater on by saying "it's too cold in here", or switch my lights and projector off by saying "shut it all down", or get the PC to play a waterfall sound when I say "help me to sleep", I am constantly trying to think of new commands and despite my limited technical ability this has become one of my favorite hobbies.

Anyway, what I want is to be able to say "Who was the first president of the united states?" or "What do gerbils like to eat?" etc and get a short answer.

Because I am generally the least technical person in this forum I have gotten nowhere  :bonk I tried looking at the scrape functionality and using wikipedia as the source but I think it is just too much for my tiny little brain as I can't get her to return a single word.

Have any of you guys already built some XML that will do this that I might be able to download?

Loving your work as always.

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Siri like functionality i.e. ask your computer any question
« Reply #1 on: April 09, 2012, 07:42:04 AM »
Hi guys,

This is pretty much the only thing missing for me now.  I am driving my friends insane with either jealousy or boredom depending how techy they are because I can't stop telling them how cool it is to be able to switch my heater on by saying "it's too cold in here", or switch my lights and projector off by saying "shut it all down", or get the PC to play a waterfall sound when I say "help me to sleep", I am constantly trying to think of new commands and despite my limited technical ability this has become one of my favorite hobbies.

Anyway, what I want is to be able to say "Who was the first president of the united states?" or "What do gerbils like to eat?" etc and get a short answer.

Because I am generally the least technical person in this forum I have gotten nowhere  :bonk I tried looking at the scrape functionality and using wikipedia as the source but I think it is just too much for my tiny little brain as I can't get her to return a single word.

Have any of you guys already built some XML that will do this that I might be able to download?

Loving your work as always.

-P
Hi MrWolf, yes there is an option to do this. You can use the "pandorabot", it is not Siri, but you can do small talk with him  :D
Open in the command builder on the right the megabin.xml "click on the earth button", there is a command group PANDORABOT.

Kalle
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Siri like functionality i.e. ask your computer any question
« Reply #2 on: April 09, 2012, 08:02:10 AM »
The problem here is finding an online resource with short answers that come in a reliable, consistent format so that we can have some hope of scraping them.

So far I have not found such a site.  Even if you do, there is always the likelihood that eventually they will change their format and you will have to rewrite your command to match.

I could write a command that scrapes wikipedia for a particular question, but it won't necessarily work for another question because the information comes back in a different format.

You must also consider that asking open questions where you can say anything will muddy the waters as far as VC's other commands are concerned, so I would suggest if you try it to start with a phrase that is a little more distinct like: "query, who is ..." or "question, who is..."

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Siri like functionality i.e. ask your computer any question
« Reply #3 on: April 09, 2012, 09:14:26 AM »
Hi gents,

I tried Pandorabot and whilst it was good fun she wasn't very knowledgeable and didn't have the answer to many of my questions, she spent more time telling me how fantastic her creator was ;)

How about different sites for different questions?...  IMDb seems to be fairly perpetual in its layout, thought I don't know if that means the code underneath is, which I think it what your scrape function is reliant on.  You could ask for plot information for a given film, that would be pretty cool.

Dictionary.com doesn't seem to have changed much in recent years, though again the code may have done.  You could use that for looking up definitions of words.

I suppose the more sites you use the more likely it is that part of the code will fail when that site decides to change the way it works so maybe that suggestion is mute.  Maybe I'm at a point where I just need some simple instructions on using the scrape function so that I can write and update my own code.

With trial and error I got nowhere, I tried taking an existing scrape function and altering the URL, but iit didn't do anything, so I tried looking at the source code of the original URL and the new one I had chosen to see if there was a particular phrase it was looking for to return its results but that didn't seem to get me anywhere either and I gave up.

Are there any basics I should know?

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Siri like functionality i.e. ask your computer any question
« Reply #4 on: April 09, 2012, 09:22:34 AM »
Thinking about it, google define could be a good source for a lot of questions...

https://www.google.co.uk/search?hl=en&safe=off&output=search&sclient=psy-ab&q=define%

you can add any word after the percentage and return an answer that is always in the same format (I think)

A scrape function for this would be a really good step in the right direction for me, but I am way too stupid to know how to write it!

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Siri like functionality i.e. ask your computer any question
« Reply #5 on: April 09, 2012, 09:36:40 AM »
The first prerequisite is knowing how to use regular expressions.  Without that you are not going anywhere.  There is a lot of information on the web on this topic.  This link is a handy resource but not necessarily the place to start if you know nothing.
http://www.mikesdotnetting.com/Article/46/CSharp-Regular-Expressions-Cheat-Sheet

You also need to know the basics of using payloads in VoxCommando, and the basics of editing commands.



jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Siri like functionality i.e. ask your computer any question
« Reply #6 on: April 09, 2012, 10:10:07 AM »
Actually it looks like ask.com is a pretty good place for lots of common questions.  Here's a command that works pretty well!

[2013 UPDATE: ask.com website has changed, so the attached commands will not work as is. See more recent posts later in this thread for working Wolfram|Alpha and DuckDuckGo solutions. -NB. ]
« Last Edit: December 21, 2013, 10:57:50 AM by nime5ter »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Siri like functionality i.e. ask your computer any question
« Reply #7 on: April 09, 2012, 02:25:42 PM »
Actually it looks like ask.com is a pretty good place for lots of common questions.  Here's a command that works pretty well!
Good job James, that command works fine for me too  :clap

Kalle

PS: If we can scrape from WolframAlpha, that would be perfect
« Last Edit: April 09, 2012, 02:47:44 PM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Siri like functionality i.e. ask your computer any question
« Reply #8 on: April 09, 2012, 02:49:40 PM »
Yes, it seems very good.  Of couse you have to ask the right type of questions.  Here are some that work well.


Query, Who is the president of the united states?

Query, Who is the tallest man?

Query, Who is the shortest man?

Query, How many minutes are there in a year?

Query, what is the capital of Iceland?

Query, how many stars are there on the American Flag?

Query, what is the square root of pi

Query, How many days are there in the month of January?

Query, Who is the prime minister of Canada?

Query, How far is the earth from the moon?

Query, What is the longest day of the year?

Query, What is the atomic weight of Uranium?

Query, How many inches are there in a mile.?

and so on...

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Siri like functionality i.e. ask your computer any question
« Reply #9 on: April 09, 2012, 06:38:41 PM »
PS: If we can scrape from WolframAlpha, that would be perfect

I tried before.  It is too hard.  Wolfram returns data in different formats and with graphics elements.  It is probably possible if using their official api but that is not free.  ::yuck

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Siri like functionality i.e. ask your computer any question
« Reply #10 on: April 10, 2012, 03:54:21 AM »
I tried before.  It is too hard.  Wolfram returns data in different formats and with graphics elements.  It is probably possible if using their official api but that is not free.  ::yuck
Ok, thanks for your trial.
***********  get excited and make things  **********

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Siri like functionality i.e. ask your computer any question
« Reply #11 on: April 10, 2012, 07:43:17 AM »
Thank you very much!  Ask.com seems to work great.

My computer isn't always understanding me well enough, but it will; just need to figure out either more training or better mic placement/setting.

You are the best, and the beers are really piling up for you this side of the ocean!

-P

Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Siri like functionality i.e. ask your computer any question
« Reply #12 on: April 10, 2012, 09:46:30 AM »
Dictation can be a bit hit and miss it's true, and Ask's fuzzy logic isn't that fuzzy, but I found it helped to turn alternates on, and keep an eye out for the closest match to what I actually said.

I hope you are keeping them cold.

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Siri like functionality i.e. ask your computer any question
« Reply #13 on: April 10, 2012, 02:01:19 PM »
Thanks bud, will look at alternates now.

There are 3 pints of Carling sat here waiting.  If they start to go warm do you want me to drink 'em for you?  ;)

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

Christian

  • Jr. Member
  • **
  • Posts: 28
  • Karma: 0
    • View Profile
Re: Siri like functionality i.e. ask your computer any question
« Reply #14 on: July 16, 2012, 07:34:13 PM »
I just checked this function out when it was released and mayby you guys have done some work on it since then, but as far as I can remeber it was mainly a help function for VC (?)..

I once tried to set up a pandorabot, and as far as I can remember it was possible to import a lot of different "sets" of dialouges to the bot, so you didn't had to program everything your self, and I think I found some packs with these kind of questions, like general kowlege, some history facts and stuff... Is it an Idea to make a voxbot that users can upload into a shared bot?
Upload it to a forum thread and some moderators imports them? that way everyone could use it, or otherwise use the uploaded files in their own bot?


“Wherever beer is brewed, all is well-wherever beer is drunk, life is good.” — Czech proverb