Posts

Download course material from coursera

Lot of people finding it hard to download all material(video,pdf,ppt) from coursera . Here is simple that will do the same for you.

There is open source tool called Coursera-dl , using that you can download it using a single command.

git clone https://github.com/coursera-dl/coursera-dl
cd coursera-dl pip3 install -r requirements.txt ./coursera-dl -u <Email-id> -p <Password> --subtitle-language en <course_name> This will download all your course material .

Build Knowledge Graph from unstructured corpus using Machine Learning

Image
Problem of creating knowledge graph from unstructured data is a well known machine learning problem. Not even a single org has achieved 100% accuracy for completely enriched knowledge graph . I have few findings that will help to kick-start for a person who is new in to this .

Before move to findings , i will let you to walk through the problem of building knowledge graph from unstructured corpus . Lets consider this scenario . Suppose we have very small corpus :

"Apple was founded by Steve jobs and current CEO is Tim Cook. Apple launched several products like Ipad, iphone , MAC etc. "

Corpus may be very complex sentences also . Problem is how can we build a knowledge graph out of this unstructured corpses . If we create generic knowledge graph , then our system should be able to provide answers like "who founded Apple ?" , " What are products launched by Apple ?" etc .






Few techniques to create knowledge graph :

1.) Supervised Technique :
Supervised models use…

Getting started with Tensorflow , keras and theano - Development setup with Anaconda Installation

Below are the steps to setup your development environment  for Deep learning :
1.) Download and Install Anaconda from here :https://www.continuum.io/downloads
2.) Create a conda environment for data science development so that it doesn't affect the other install components .
conda create -n tensor_keras_py2.7 python=2.7 pandas scikit-learn jupyter matplotlib
3.) Activate the created environment
source activate tensor_keras_py2.7 4.) Install tensorflow inside activated env. pip install tensorflow 5.) Install keras inside activated env.    pip install keras 6.) Install opencv inside activated env.    pip install opencv-python

Test your environment
1.) Type ipython in the shell , which should open ipython console . 2.) Type import tensorflow,keras  , it should reply using tensorflow backend 


Switching keras backend from Tensorflow to theano keras backend is set in a hidden file stored in your home path . You can find it at $/.keras/keras.json . You can open it with a text editor and you sh…

Getting started with Deep Learning Caffe Framework - Fastest way(Installation +Web Demo)

Image
Here is the fastest way to get started with caffe deep learning framework with installation and basic we application demo for image classification :

Installation : Here i am using caffe official ubuntu image and running it on docker . Follow the steps mentioned below :
1.) Install docker setup on your machine . Follow this link : https://docs.docker.com/engine/installation/#time-based-release-schedule.
2.) I have build caffe ubuntu image and push to docker hub . You can pull it in to your local.
docker pull anishratnawat/caffe_deep_learning
3.)Run this command on terminal :
docker run -ti -p 5000 anishratnawat/caffe_deep_learning bash  
 // it will download the image if its not downloaded before.
// When downloading finishes , terminal will enter in to image bash and your terminal will change to :
root@d3a683f24784:/workspace#
If you install any necessary packages inside that image then you need to commit it to make changes persist .
docker commit <ContainerId> <NewImageName>

Opencv Java Web Integration on eclipse ubuntu

Image
Using opencv java , you can develop web application which uses opencv image processing libraries on the server.
Prerequisite:
1.) Eclipse Java J2EE version.
2.) Install opencv using configure and download opencv

Now, we will define OpenCV as a user library in Eclipse, so we can reuse the configuration for any project. Launch Eclipse and selectWindow –> Preferences from the menu.


Navigate under Java –> Build Path –> User Libraries and click New....

Enter a name, e.g. OpenCV-2.4.9, for your new library. Now select your new user library and click Add External JARs.... Browse through /home/anish/opencv-2.4.9/build/lib and select opencv-249.jar. After adding the jar, extend the opencv-249.jar and select Native library location and press Edit.... Select External Folder... and browse to select the folder /home/anish/opencv-2.4.9. If you have a 32-bit system you need to select the x86 folder instead of x64. Your user library configuration should look like this:
You have successfully config…

OpenCV 2.4.9 JAVA/CPP/Python Installation in Ubuntu 14.04

Image
OpenCV2.4.9 installation in ubuntu is not straight forward , sometimes due to dependencies , some people won't be able to end with successful installation.In this guide, i will show you how to install OpenCV with a lot of the features it provides. Here are some of the things that are going to be enabled when you are finished following through with this installation tutorial:

1.) Qt version of the HighGUI module (Better 2D window interface with zoom, image saving capabilities, etc)
2.) OpenGL support
3.) C++ interface and examples
4.) C interface and examples
5.) Python interface and examples
6.) Java interface and examples

OK, so the first step is to make sure that everything in the system is updated and upgraded. Open the terminal and write this:

sudo apt-get update sudo apt-get upgradeNow, you need to install many dependencies, such as support for reading and writing image files, drawing on the screen, some needed tools, other libraries, etc… This step is very easy, you only nee…

Sudoku using dancing link - Java implementation

Image
Here is a algorithm which uses dancing link to solve algorithm X(exact cover) that solves upto 100*100 sudoku. Algorithm has been implemented using  JAVA and can be able to solve Sudoku of any difficulty level(easy,hard,very hard).
Algorithm works as follows:-
1.) Algorithm first find out the number of possible elements in each cell , algorithm for this can be seen in the code.
2.) After this apply rule1 which says finds  that cell which has a single possible element , this works recursively until we find single possible element.
3.) After this apply rule2 which says if there is a number which can go into only one cell, then assign that number to that cell.
4.) Rule2 and rule1 run recursively.
5.) Still if we find possible number of elements in some cell then create a dancing link for sudoku puzzle , reduce the puzzle in to exact cover form and solve it using algorithm X in a efficient way.To make it efficient,first we implemented rule1 and rule2 ,firstly algorithm try to solve sudoku…