Wednesday, 15 April 2015

How the Google Predicition API Can Help a Business Ratings and Reviews Service Like Wasamundi.com

This is the second in a series of post about how the Google Prediction API can help some start-ups I know in Cameroon. This series is aimed at promoting the creation of smarter services based on machine learning within the community. Here are other parts of the series:
Part 1: How the Google Predicition API Can Help a Jobs Website Like Njorku.com


Wasamundi.com is a Cameroonian business reviews and ratings service on a mission to increase and improve visibility of local businesses online across search engines, social networks and mobile phones.




















The Google Prediction API on the other hand is a machine learning cloud service that can be used to analyse data and predict future outcomes.

Looking at Wasamundi there are 2 ways I think the Prediction API can help:
  • Customer sentiment analysis
  • Spam detection
For a case like customer sentiment analysis you are interested in determining the mood of your customers about a particular business using machine learning. So you will send comments users make on the companies page to the Prediction API which then replies with the sentiment the comment carries. For example the following comments are indicated with their inferred sentiments (The training data CSV file will be of this format without the list item dots):
  • "happy","Ate the best fried ever at Mouth Power this afternoon"
  • "angry","I hate the shawarma at mile 80 park, too wet!"
  • "sad","I wish the waitress at Buea Cafe was not frowning all day"
  • "indifferent","Just had a some coffee at the Mid Town Coffee House"
After creating training data such as this, all you will have to do is send any user comment to the Prediction API and it will reply with the mood inferred by the comment e.g sending a comment like "Had a two plates of potato and egg at UB junction and I will say its the best in town" to the API will give you a reply of "happy". Keep in mind that you want to have hundreds or thousands of samples for each mood.

You can then use this inferred sentiments  to do some more analysis e.g whats the most loved business based on comments and not "star ratings".

For the spam detection use case, it will be done similarly but in place of the moods you will want to replace it with categories like "spam" and "not spam".

Want to give the Prediction API a spin? Check out the docs.


Monday, 30 March 2015

How the Google Predicition API Can Help a Jobs Website Like Njorku.com

This is the first in a series of post about how the Google Prediction API can help some start-ups I know in Cameroon. This series is aimed at promoting the creation of smarter services based on machine learning within the community. Other Parts in the series:
Part 2: How the Google Predicition API Can Help a Business ratings and Reviews Service Like Wasamundi.com





There has been lots of buzz about the cloud in recent years and you may have heard of popular cloud related acronyms like IaaS (Infrastructure as a Service), PaaS (Platform as a Service) and SaaS (Software as a Service). If you have never heard of them, close this page, go to Youtube and watch Gangnam Style for this was not written with you in mind. Now back to the cloud talk. Today I invent a new acronym, MLaaS (Machine Learning as a Service) - at least I think I have invented the acronym.

Machine Learning.

If you know what machine learning is, skip to "How the Google Predicition API Can Help a Jobs Website"

Machine Learning is ... well you guessed it, "Machine Learning". Its all about teaching machines to make predictions, decisions or recommendations based on historical data (your computer science teacher may not describe it like that, but then he did not write this post).

Now put one and two together and you get Machine Learning as a Service which is a cloud service that provides apps or humans with machine learning services via a pay-as-you-use model. Freeing them of the burden of having to build machine learning software themselves, buying a machine to run it or both.

The Googe Prediction API is an example of a machine learning cloud service.

How the Google Predicition API Can Help a Jobs Website.

The Google Predicition API a machine learning service which in Google words gives you the ability to "Use Google’s machine learning algorithms to analyze data and predict future outcomes using a familiar RESTful interface."

This can be used by a jobs website like Njorku in the following ways:
  1. Automatically categorize user submitted CVs. For example a user should submit her/his CV and it will be categorized as Marketing, Software Engineering, or Legal to name a few so that only jobs relevant to that category are emailed to the user. The reverse can also be done where by jobs crawled from other websites are automatically categorized using machine learning and emailed only to users interested in that category
  2. Do a "Users who viewed/liked this job also viewed/liked the following jobs" section. Where by a user viewing a banking job gets recommended other jobs based on what previous viewers of that job liked/viewed.
Many more ideas come to mind but I planned to write this in an hour and for you to read this post in five minutes but I fear I am already failing at one if not both.

So How Will This Work ?

For the first use case, people will have to build the training data for the model. This can be a CSV file that looks like this:  


"marketting", "text found in one user submitted marketing CV"
"software engineering", "text found in user submitted software engineering CV"
"marketting", "text found in another user submitted marketing CV"
"legal", "text found in a lawyers CV"

To build a good model, you will need hundreds of CVs per category but a usable model can be created with at least tens of CVs per a category.

This is a basic idea with the least implementation information required to push it through. Taking it to production will need some more development. You can start by reading the Google Prediction API documentation.

Next week I will write on how a real estate service like WasaHostel or a local business directory like WasaMundi can use the Google Prediction API to their advantage.

You can recommend any start-ups you will like me to "make smarter". :-)

Update:

How the Google Predicition API Can Help a Business ratings and Reviews Service Like Wasamundi.com

Thursday, 11 December 2014

Quickstart: First Steps with Google Compute Engine - Launching an Apache Web Server

I have been playing with Google Compute Engine (from here on called GCE) for about 2 months now and I have come to the decision of creating a quickstart tutorial for GCE. There is already one in the GCE docs but it requires you to download the SDK and misses out some steps (indicated later) but I will take a different approach with everything being done in the browser, no SDK to be downloaded.

Just in case you got here without having a clear understanding of what GCE is all about, here is Google's definition of GCE which I think should be clear enough.

Google Compute Engine is a service that provides virtual machines that run on Google infrastructure. Google Compute Engine offers scale, performance, and value that allows you to easily launch large compute clusters on Google's infrastructure. There are no upfront investments and you can run up to thousands of virtual CPUs on a system that has been designed from the ground up to be fast, and to offer strong consistency of performance.
 Now lets get to hacking !.


First you have to create a Google account (if you already have a Gmail account, you're good to go). Visit cloud.google.com to sign in to the cloud console or create an account if you don't have one. As of now Google gives $300 cloud credit and note that you need to have a credit card to receive this though its not real money. I am using the cloud credit for this tutorial.

If you have signed in and gotten your credit, then head to the cloud console if not automatically redirected there by heading to https://console.developers.google.com . Assuming you are new to the Google Cloud Platform, you should not see any listed projects

As in the screen shot below you should see a "Create Project" button. Use it to create a new project. You will be asked to give a Project name, which can be anything you like and a Project ID which should be unique and is used as the domain for your project if you use AppEngine hence the same rules that go for choosing a domain name apply.


After your project is opened, select compute on the left navigation bar and go to 
Compute->Compute Engine->VM Instances. It should not show much since its your first time with GCE I assume. Click the "New Instance" button to create a new Virtual Machine (VM).



You will have to fill in some information.
Name - The name you want for your VM  
Metadata - [optional] Used to add info about your VM which can be used by startup scripts and lots more. Skip this for now.
Firewall - You will need to check http and/or https since we are setting up a web server. (If in future you intend to create an app which does not serve trafic then you can leave this unchecked) 
Zone - This is the location of you VM. 

Machine type - Select the type of machine you want according to your needs 
Image - The operating system you want. For this tutorial, use ubuntu-1404-trusty-... 
Networking - If you choose Ephemeral for external IP, your IP will change each time your VM restarts but they are easier to create.

Create the VM and lets get to the interesting stuff.

In your list of VMs (you should have just one VM if you have been following this tutorial) you will see the SSH button on the right side of each VM item. Click it to load up a browser based command line.




Enter the following commands to install apache

me@my-first-instance$ sudo apt-get update
me@my-first-instance$ sudo apt-get install apache2

You should head back to where you had your VMs listed, copy the external IP and insert it into your browser to view the Apache default home page which may look like this:
Your web server is up and running.

Don't forget to leave your thoughts, questions and/or corrections in the comments section.

Learn more about GCE from the official documentation

Saturday, 3 November 2012

Activ Spaces and the Tech World in Buea (Cameroon, West Africa)

I paid a visit to ActivSpaces and had quite an experience. ActivSpaces located in Buea is a tech start-up incubator. If you have ever been there then this article isn't for you, unless you got so much time to burn, etc. 


My visit to ActivSpaces.

If you have been to other tech incubators but not ActivSpaces, you need to get there now, and for those who (like me before this article) have never been to a tech incubator, well ... You Need Help !

I got to meet a great deal of guys who are behind some trend changing  products. 


First you got Al Banda, the community manager of activ spaces. I will like to say he is the man who keeps the amazing guys amazing.

There is also Mohamed Felata who is behind King Maker, an internet cafe Ad Network which helps cyber cafe owners make more money by effectively serving ads to their customers. It can also be used by school I.T centers to serve ads to the student population and other.

Otto Paul, who is behind Makonjoh.com, an e-commerce site which enables users to buy without using a credit card and has other functions which make it specially tailored for the Cameroonian market. 


Otto Paul (right) of makonjoh.com and I (left).
I also got to meet  Quincy, Nara and Absalom the developers of Wasahostel.com, Ryan Yoder who has worked on a couple of projects at ActivSpaces and a lot of other guys all gearing up to change the face of technology in Cameroon. 

Its a place to be and I plan to visit more often or better, be a member.

Tuesday, 2 October 2012

Cheap Energy Vs Safe Energy : Analysing the Various Energy Sources in Terms of Cost

Many people always ask the question which is the most cost effective energy source or which is the safest; coal, gas, hydro, or nuclear?. 

Many people wonder why solar or wind which are green ( environmentally safe ) are not widely used relative to hydro and other forms and nuclear which poses a great threat ( weapons and meltdowns ) is still growing in use. Well, after reading you will have an idea.

Comparing Per Kilowatt-Hour Cost Estimates for Multiple Types of Energy Production

Most Cost Effective Form of Energy Production

Bar graph comparing the total cost of electricity production per kWh between Nuclear, Coal, Natural Gas, Wind, Solar, and Hydro.
Hydroelectric is the most cost effective at $0.03 per kWh. Hydroelectric production is naturally limited by the number of feasible geographic locations and the huge environmental infringement caused by the construction of a dam. Nuclear and coal are tied at $0.04 per kWh. This comes as a bit of a surprise because coal is typically regarded as the cheapest form of energy production. Another surprise is that wind power ($0.08 per kWh) came in slightly cheaper than natural gas ($0.10 per kWh). Solar power was by far the most expensive at $0.22 per kWh—and that only represents construction costs because I could not find reliable data on production costs. Also, there is a higher degree of uncertainty in cost with wind and solar energy due to poor and varying data regarding the useful life of the facilities and their capacity factors. For this analysis the average of the data points are used in the calculations.
Three coal plant projects were used ranging from 300 to 960 MW. The construction costs of these coal plants ranged from $1.2 to $4 billion, which are less in total dollars than new nuclear ranging from $5 to $9 billion. However, due to nuclear’s higher capacity factor and larger MW rating, the per kWh construction cost of the coal plants ($0.016 to $0.019) is similar to new nuclear plants ($0.014 to $0.024).



For more info on how this results were gotten, click here


Saturday, 26 May 2012

Research Made Easier with Google Docs


over the last couple of months with Google Drive have had an impact on my
 overall document collaboration experience. I like having the ability to work on 
the go and knowing my documents are accessible when I need them.


One of the more recent changes to Docs was the addition of the research
pane.
The research pane taps into Google Search and allows you to add content 
directly from the web. You enable it under the Tools menu and it opens on the 
right side of the page, allowing you to search for website links, images, 
Google Scholar and quotes. When you find something you like, you can add it 
by clicking the insert button or dragging the content directly into your 
document. For websites, you can insert links, preview or automatically add 
footnote citations, when able, so you won’t forget your source.

The major downer for me about this new feature, is that it hasn’t migrated 
over to Google Apps. I jump between my main account and my Apps account a
 lot, so having it in both places would be nice. Google seems to be working to
 integrate all of the services they offer, so I’m sure more Docs functionality 
will be added.