views:

140

answers:

4

A parrot learns the most commonly uttered words and phrases in its vicinity so it can repeat them at inappropriate moments. So how would you create a software version? Assuming it has access to a microphone and can record sound at will, how would you code it without requiring infinite resources?

The best I can imagine is to divide the stream using silences in the sound, and then use some pattern recognition to encode each one as a list of tokens, storing new ones as you meet them. Hashing the token sequences and counting occurrences in a database, you could build up a picture of the most frequently uttered phrases. But given the huge variety in phrases, how do you prevent this just becoming a huge list? And the sheer number of pairs to match would surely generate lot of false positives from the combinatorial nature of matching.

Would you use a neural net, since that's how a real parrot manages it? Or is there another, cleverer way of matching large-scale patterns in analogue data?

A: 

maybe - do not attempt to store each clip seperately, instead, do a similarity match to the target number you wish to learn say maybe a dozen... so in comes a sound - you match to the closest one of the dozen you are tracking - and when you find a sufficient pattern match to one of those, you average this new sound into the stored version - giving a new version...

if the incoming sound does not match anything stored - throw it away.

the bootstrap would be the toughest part - distinguishing the initial number of target phrases...

anyhow - off the top of my head. hth

Randy
+2  A: 

It's been done, sorta.

Edit: OK, since furbys are out, I'm going to suggest a Gordian-knot type of solution. Wire up a box with a speaker and a microphone, and stick an actual parrot in it. It'll work great for the demo, and then once you have your hands on some venture capital you can start work on your neural net version. Neural nets (as they've been implemented up to this point) are virtually useless, but they should be good enough to get you through the second-round demo, and by that point you'll be too big to fail.

MusiGenesis
From the article: "There was a common misconception that they repeated words that were said around them"
interjay
@interjay: the key word there is "common", meaning I'm not the only idiot who thought furbys repeated what was said around them. I guess *my* furby got all those swear words from somewhere else - whew!
MusiGenesis
+2  A: 

I would probably use Markov chains to emulate that.

If you haven't use markov chains to generate natural random text (or speech) before, check out Fun With Markov Chains

Nick D
+2  A: 

how do you prevent this just becoming a huge list?

I suppose you could maintain one finite list of recent words, and one infinite list of frequent words. If the parrot hears a word it hasn't heard before, it gets stored in its "short term memory". If it hears the word again, it can move the word to the list of frequent words and store it indefinitely. Once in a while, you could purge the list of recent words which contains only words or sounds that the parrot has only heard once.

KaptajnKold
Or instead of purging, use a FIFO cache, where a repeat of a phrase pushes it to the end of the list, so it remains in the cache longer.
Allon Guralnek