My Blog

 

The Prime Effect

Wednesday, 20 January 2010

 

I speak hear not of Prime Numbers, but instead of Amazon Prime. As a Prime member, one receives free 2-day shipping on all Amazon purchases, as well as reduced cost overnight shipping on all purchases. Being a prime member through my father’s membership, I have slowly but surely revolutionized the way I shop.

Last fall I took a trip to the local Walmart to pick up a few things including but not limited to a water filter. I searched for a few minutes through the kitchen area where I thought I might find what I needed, but was unsuccessful. Instead, I went home and purchased the water filter on Amazon for likely the same price if not better.

Shopping in and of itself is merely the process of searching for product(s) and then purchasing them. Now in a traditional brick and mortar store, this algorithm goes something like the following:

  1. Walk to car
  2. Drive to store (unless walking)
  3. Park vehicle
  4. Walk into and through store to find item(s)
  5. Navigate to register
  6. Wait in line
  7. Checkout
  8. Pack vehicle
  9. Drive home

Now compare with the Amazon algorithm:

  1. Open Firefox
  2. Navigate to Amazon.com
  3. Type in search query
  4. Find product
  5. Finalize cart and checkout
  6. Receive merchandise in <48hrs

Much simpler! There are certainly pros and cons to each of these algorithms, but in general the search aspect of the Amazon algorithm is vastly more efficient than walking around a store. On the contrary though, there is something to be said for trying a product on, or seeing it’s actual size in person; sometimes a picture just doesn’t cut it. That aside, for most purchases in which there is no urgency, the prices on Amazon are often more competitive, and the total shopping time is minimized.

Most online retailers add the cost of shipping to your bill, making smaller transactions less affordable. Further, no one wants to spend extra money on shipping when they think they can pick up the same product in the store, but with free 2-day shipping through Amazon Prime, this barrier to online retail is torn down. Now Amazon is my first stop shop for all of my shopping needs. It is the rare exception that I venture out to shop at a brick and mortar store for much of anything these days. Amazon saves you both time and money. It’s a more efficient shopping algorithm.

Tags: amazon
Add a comment | View my related del.icio.us bookmarks
 
 

Google Voice - A Speech Recognition Learning Engine

Friday, 14 August 2009

 

I was recently invited to join Google Voice, the free service from Google which is a revolutionary new tool for telecommunications. Google has purchased a huge block of phones numbers which they give away for free and link their services to. Some of the features I think are notable are the ability to have multiple lines ring simultaneously and a call can be connected on any of them. You can also view text messages and voice messages through a web interface. The services can be customized for different users and different people calling you. All in all a pretty innovative and revolutionary product.

I’d like to take some time to elaborate on one particular feature: voicemail to text translation. Automatic Speech Recognition (ASR) is known to be a challenging field of computer science particularly artificial intelligence. There are many applications for ASR. For example, many phones have the ability to be controlled (somewhat) via your voice. I could say some very basic commands such as “Call Heather,” and it will find my contact named Heather and call that number, if it deciphers things properly. Microsoft also has some voice recognition software brilliantly demonstrated in this video:

ASR is commonly conducted using a Hidden Markov Model based algorithm. A Markov model is a concept from probability theory and statistics which when designed properly can be used to provide probabilities with different events, in this case words or Phonemes, the smallest unit of sound in our speech. This type of analysis can be used to translate speech to text, but because it is a probabilistic model, there will be error.

To produce accurate ASR results, you must have a good Markov Model. This model is produced based upon training data. You take a set of speech inputs and translate and associate them with the actual translation. From a sufficient set of training data you can produce an accurate model which can be used for ASR.

Google Voice, especially after continued further adoption, will have a vast set of speech samples from an enormous base of different human voices of varying different dialects and accents of different degrees of sound quality. My suggestion for Google Voice is to allow users to edit the voicemail transcription to correct it. This would provide Google a huge base for training samples such that the system could be constantly evolving to continually provide better ASR services.

Furthermore, if users could modify their voicemail transcriptions they could more easily search their past messages for certain keywords. If your search term was translated improperly then the current search would have a more difficult time trying to find the message you might be looking for.

Google could also harness this power (maybe coupled with some natural language processing, another complex field), to allow users to search the web through speech instead of through a typed search query. The potential applications of this type of technology are seemingly endless.

Google is also a very friendly to the developer community which frequently provides their services to other developers through an Application Programming Interface (API). Examples of such services include Google Charts which provides users all of the charting a plotting utilities through a common API. Google allow developers all over the world to utilize the knowledge they have gained through the collective effort of users correcting their voicemail.

Google Voice in and of itself is an innovative product which could change the way people communicate. In typical Google fashion though, the data that it controls and has access to can be used in completely new and unrelated applications (such as Google Flu Trends). Google Voice has the potential to optimize Automated Speech Recognition.

Tags: Google ai asr speech-recognition
Add a comment | View my related del.icio.us bookmarks
 
 

New Layout

Thursday, 30 July 2009

 

I built this website nearly a year ago now and it has served me well. It isn’t the most popular site on the web (far from it actually, I have the Google Analytics to prove it), but nonetheless I have learned a lot about web development and managing web services. It has served as a testing ground for new ideas as many of the features of a blog or personal website are fairly simplistic. Before building this site I knew little to nothing about HTML, CSS, JavaScript, AJAX, or Ruby On Rails. While I wouldn’t consider myself an expert in any of these fields after building and maintaining this site for a year I certainly have acquired a good working knowledge of how these technologies can be used in harmony to produce a web application.

The old layout I designed from the ground up by hand (well, I might have taken some from the rails scaffolding, but not too much). I learned a lot, and was frustrated a lot. In the end my layout and design were in all honesty, nothing that great. I have little artistic skill so it was my goal to produce a design which was not disagreeable, and I like to think I accomplished that. Now that I have had that learning experience though, I thought it would be good to use a real CSS template which looks professional, and that is what you see here. There was a learning experience in this endeavor as well as integrating a new CSS template into an existing site takes some work and understanding of the new template. You can’t just point to the new CSS sheet and be done with it.

This template was taken from http://freecsstemplates.org, a site which has over 400 templates available for free under a Creative Commons License. They have some great looking templates, and I appreciate their work. It certainly makes this site look a lot better!

Tags: css template html
Add a comment | View my related del.icio.us bookmarks
 
 

OpenID

Wednesday, 08 July 2009

 

For the past year almost this blog has continually accumulated spam blog comments from automated bots. There are several different ways one can avoid this spam, some ways easier than others. One common method used in many online forms is Captcha which gives an image of letters for the user to copy. For a small site such as this even trivial measures such as requiring the user to enter the current date would probably have reduced if not eliminated the problem. To combat this problem though I chose to implement a user authentication system based on OpenID, and require all users to authenticate before commenting on a blog post. By using a OpenID based user authentication system I can not only associate comments with users, but users can do so without having to register a username and password with my site.

This project was really my first experience with OpenID. I did not have an OpenID account before I created one to debug my development. Since then I have found a couple of websites which are OpenID enabled such as Stackoverflow, but by in large (at least from what I can tell), most sites have not made the transition yet. After enabling OpenID on this site I have gained a great appreciation for OpenID in general and I’m anxious to see the rest of the online community adopt this standard.

Tags: openid
Add a comment | View (1) comment| View my related del.icio.us bookmarks
 
 

Python default method parameters

Tuesday, 14 April 2009

 

Working with Python today I stumbled upon an issue with method declaration and default parameters. I wanted each instance of my class to have a data member which was an array. Because I didn’t necessarily want to have to specify the empty array when initializing all of these instances, I set it as a default argument like this:

def __init__(self,arg1,arg2=[]):
     self.arg1 = arg1
     self.arg2 = arg2

As it turn out as explained here, default parameters as evaluated when the function definition is executed. As a result, the default argument [] is compiled to an array object, and then every call to the constructor which does not specify arg2, will get a pointer to this same array. This is not at all what I wanted, and took quite some time to debug. Here are two solutions to this problem.

def __init__(self,arg1,arg2=eval("[]")):
     self.arg1 = arg1
     self.arg2 = arg2

Or probably more efficiently:

def __init__(self,arg1,arg2=None):
     if(arg2 == None):
          self.arg2 = []
     else:
          self.arg2 = arg2
     self.arg1 = arg1

This is clearly stated in bold text on the aforementioned page, but it was very tricky to narrow down the problem to that single method declaration.

Tags: python
Add a comment | View (1) comment| View my related del.icio.us bookmarks
 
 

Blog archive