Python tutorials

Python: Slice Notation on Tuple

Introduction The term slicing in programming usually refers to obtaining a substring, sub-tuple, or sublist from a string, tuple, or list respectively. Python offers an array of straightforward ways to slice not only these three but any iterable. An iterable is, as the name suggests, any object that can be iterated over. In this article, we’ll go over everything you need to know about Slicing Tuples in Python. Slicing a Tuple in Python There are a couple of ways to […]

Read more

Change Tick Frequency in Matplotlib

Introduction Matplotlib is one of the most widely used data visualization libraries in Python. Much of Matplotlib’s popularity comes from its customization options – you can tweak just about any element from its hierarchy of objects. In this tutorial, we’ll take a look at how to change the tick frequency in Matplotlib. We’ll do this on the figure-level as well as the axis-level. How to Change Tick Frequency in Matplotlib? Let’s start off with a simple plot. We’ll plot two […]

Read more

How to Sort a Dictionary by Value in Python

Introduction A dictionary in Python is a collection of items that stores data as key-value pairs. In Python 3.7 and later versions, dictionaries are sorted by the order of item insertion. In earlier versions, they were unordered. Let’s have a look at how we can sort a dictionary on basis of the values they contain. Sort Dictionary Using a for Loop We can sort a dictionary with the help of a for loop. First, we use the sorted() function to […]

Read more

6 Practices to enhance the performance of a Text Classification Model

Introduction A few months back, I was working on creating a sentiment classifier for Twitter data. After trying the common approaches, I was still struggling to get good accuracy on the results. Text classification problems and algorithms have been around for a while now. They are widely used for Email Spam Filtering by the likes of Google and Yahoo, for conducting sentiment analysis of twitter data and automatic news categorization in google alerts. However, while dealing with enormous amount of text […]

Read more

Extracting information from reports using Regular Expressions Library in Python

Introduction Many times it is necessary to extract key information from reports, articles, papers, etc. For example names of companies – prices from financial reports, names of judges – jurisdiction from court judgments, account numbers from customer complaints, etc. These extractions are part of Text Mining and are essential in converting unstructured data to a structured form which are later used for applying analytics/machine learning. Such entity extraction uses approaches like ‘lookup’, ‘rules’ and ‘statistical/machine learning’. In ‘lookup’ based approaches, […]

Read more

Essentials of Deep Learning : Introduction to Long Short Term Memory

Introduction Sequence prediction problems have been around for a long time. They are considered as one of the hardest problems to solve in the data science industry. These include a wide range of problems; from predicting sales to finding patterns in stock markets’ data, from understanding movie plots to recognizing your way of speech, from language translations to predicting your next word on your iPhone’s keyboard. With the recent breakthroughs that have been happening in data science, it is found […]

Read more

An NLP Approach to Mining Online Reviews using Topic Modeling (with Python codes)

Introduction E-commerce has revolutionized the way we shop. That phone you’ve been saving up to buy for months? It’s just a search and a few clicks away. Items are delivered within a matter of days (sometimes even the next day!). For online retailers, there are no constraints related to inventory management or space management They can sell as many different products as they want. Brick and mortar stores can keep only a limited number of products due to the finite space […]

Read more

Introduction to StanfordNLP: An Incredible State-of-the-Art NLP Library for 53 Languages (with Python code)

Introduction A common challenge I came across while learning Natural Language Processing (NLP) – can we build models for non-English languages? The answer has been no for quite a long time. Each language has its own grammatical patterns and linguistic nuances. And there just aren’t many datasets available in other languages. That’s where Stanford’s latest NLP library steps in – StanfordNLP. I could barely contain my excitement when I read the news last week. The authors claimed StanfordNLP could support more […]

Read more

Building a Recommendation System using Word2vec: A Unique Tutorial with Case Study in Python

Overview Recommendation engines are ubiquitous nowadays and data scientists are expected to know how to build one Word2vec is an ultra-popular word embeddings used for performing a variety of NLP tasks We will use word2vec to build our own recommendation system. Curious how NLP and recommendation engines combine? Let’s find out!   Introduction Be honest – how many times have you used the ‘Recommended for you’ section on Amazon? Ever since I found out a few years back that machine […]

Read more

A Comprehensive Guide to Attention Mechanism in Deep Learning for Everyone

 Overview The attention mechanism has changed the way we work with deep learning algorithms Fields like Natural Language Processing (NLP) and even Computer Vision have been revolutionized by the attention mechanism We will learn how this attention mechanism works in deep learning, and even implement it in Python   Introduction “Every once in a while, a revolutionary product comes along that changes everything.” – Steve Jobs What does one of the most famous quotes of the 21st century have to do with […]

Read more
1 141 142 143 144 145 181