Software Architecture Diagrams as Code

I love the idea of everything as code. It enables use of version control for all aspects of software development. These days we use everything as code approach for documentation, infrastructure provisioning, deployment automation, continuous integration build jobs, pull request and issue templates, and many other things. The beauty of this approach is that it enables us to use the same tools as we use use for software development.

One aspect of the software development where we are lacking the as code approach is in creating architecture diagrams.

Continue reading “Software Architecture Diagrams as Code”

Machine Learning using TensorFlow and PyCharm Series: Part 1: Setting up environment and writing our first TensorFlow program

TensorFlow is an open source computation framework for building machine learning models. Its design make use of lessons learnt from earlier machine learning frameworks — Torch, Theano, Caffe, and Keras. Torch is the earliest machine learning framework that made of the term Tensor. Theano makes use of Graph data structure to store operations and compile them to high-performance code. Caffe is a high performance framework written in C++ and makes feasible to execute applications on different devices. Keras provides an easy to use API to interface with various machine learning frameworks like Theano.

Continue reading “Machine Learning using TensorFlow and PyCharm Series: Part 1: Setting up environment and writing our first TensorFlow program”

Building a Sentiment Analysis Python Microservice with Flair and Flask

Flair delivers state-of-the-art performance in solving NLP problems such as named entity recognition (NER), part-of-speech tagging (PoS), sense disambiguation and text classification. It’s an NLP framework built on top of PyTorch.

In this post, I will cover how to build sentiment analysis Microservice with flair and flask framework.

Continue reading “Building a Sentiment Analysis Python Microservice with Flair and Flask”

Sentiment Analysis in Python with TextBlob

Welcome to the eleventh blog of 52 Technologies in 2016 blog series. If you are following this series then you would have probably noticed that I already wrote week 11 blog on tweet deduplication. I was not happy with the content so I decide to write another blog for week 11.

In week 11, I decided to spend time to learn about text processing using the Python programming language. We will only focus on Sentiment Analysis in this blog. I have written about sentiment analysis multiple times in last few years. We learnt how to do sentiment analysis in Scala using Stanford CoreNLP in week 3 blog. Sentiment analysis gives you the power to mine emotions in text. This can help you build awesome applications that understand human behavior. Few years back, I built an application that helped me decide if I should watch a movie or not by doing sentiment analysis on social media data for a movie. There are many possible applications of Sentiment analysis like understanding customer sentiment for a product by analysis of reviews.

You can read full blog here https://github.com/shekhargulati/52-technologies-in-2016/blob/master/11-textblob/README.md

Python json object_hook

Today, I was building a REST client for one of the REST server applications using Python. I decided to use Python requests library for writing my REST API client. Requests is a very easy to use library that you can use to quickly bootstrap your REST API client. Writing REST client for REST endpoints was a matter of an hour. This REST API client will be used from our custom Jython(JVM implementation of Python) REPL. REST API has only two endpoints that return JSON objects. Response of first endpoint was fed to the second endpoint. I was returning the JSON response as Python dictionary. User can change values of the first response and pass it to the second API call. In Python, you work with dictionary as shown below. Continue reading “Python json object_hook”

Python abc.py Puzzle

Let me start with the confession that I am not an expert Python developer so this might not be a surprise for some of you. Yesterday, I was working on a Python REST API client using awesome requests library for one of my server application. To quickly hack my client, I created a Python virtual environment using virtualenv and installed required libraries using pip. I was ready to play with Python(again). I created a new file abc.py and added a method. For demonstration, let’s suppose our method is called hello, as shown below. Continue reading “Python abc.py Puzzle”

Using boto3 with Jython

Few days back I had a requirement that I had to use boto3 with Jython. boto3 is AWS EC2 python SDK that you can use to work with various Amazon Cloud API’s. Jython is the JVM implementation of Python. We were packaging our Jython scripts and boto3 and its dependencies inside a JAR. boto3 and Jython work great together when you use them in a normal way i.e. when boto3 can load its data model files from file system. This does not work when you package your script and its dependencies inside a JAR as the model files are then not available on the filesystem but are available on the classpath. In this blog, I will show you how we used boto3 to overcome this limitation. Continue reading “Using boto3 with Jython”

Getting Started with vSphere EXSi — The Missing Tutorial

Getting Started with vSphere

Today, I got an opportunity to work with vSphere. The plan for the day was to install vSphere on one of our machine and then connect to it using a Python API so that we can launch virtual machines. The official documentation lacked clarity and it was not easy for a newbie like me to get started with vSphere. Throughout the day we faced numerous problems, stumbled across many blogs and vmware forum posts, and finally managed to create our first VM via the official vSphere Python API — pyvmomi. In this detailed blog, I will go over all the steps required to get started with vSphere. We will start with how to install vSphere on a machine, then look at how to install command-line client on a linux machine, and finally learn how to talk to the vSphere host using Python. This blog is a work in progress and I will continue updating it as I learn more about vSphere. Continue reading “Getting Started with vSphere EXSi — The Missing Tutorial”

Day 16: Goose Extractor–An Article Extractor That Just Works

Today for my 30 day challenge, I decided to learn how to do article extraction using the Python programming language. I have been interested in article extraction for a few month when I wanted to write a Prismatic clone. Prismatic creates a news feed based on user interest. Extracting article’s main content, images, and other meta information is a very common requirement in most of the content discovery websites like Prismatic. In this blog post, we will learn how we can use a Python package called goose-extractor to accomplish this task. We will first cover some basics, and then we will develop a simple Flask application which will use the Goose Extractor API. Read the full article here https://www.openshift.com/blogs/day-16-goose-extractor-an-article-extractor-that-just-works

 

Day 9: TextBlob–Finding Sentiments in Text

Today for my 30 day challenge, I decided to take a break from JavaScript and learn about text processing using the Python programming language. I will be focusing on Sentiment Analysis in this blog. My interest in sentiment analysis is few years old when I wanted to write an application which will process a stream of tweets about a movie, and then output the overall sentiment about the movie. Having this information would help me decide if I wanted to watch a particular movie or not. You can read full blog here https://www.openshift.com/blogs/day-9-textblob-finding-sentiments-in-text