Creating and Importing Modules in Python

Introduction In Python, a module is a self-contained file with Python statements and definitions. For example, file.py, can be considered a module named file. This differs from a package in that a package is a collection of modules in directories that give structure and hierarchy to the modules. Modules help us break down large programs into small files that are more manageable. With modules, code reusability becomes a reality. Suppose we have a function that is frequently used in different […]

Read more

Working with PDFs in Python: Inserting, Deleting, and Reordering Pages

This article is the third in a series on working with PDFs in Python: Introduction This article is part three of a little series on working with PDFs in Python. In the previous articles we gave an introduction into reading PDF documents using Python. So far you have learned how to manipulate existing PDFs, and to read and extract the content – both text and images. Furthermore, we have discussed splitting documents into its single pages, as well as adding […]

Read more

Getting Started with Python’s Wikipedia API

Introduction In this article, we will be using the Wikipedia API to retrieve data from Wikipedia. Data scraping has seen a rapid surge owing to the increasing use of data analytics and machine learning tools. The Internet is the single largest source of information, and therefore it is important to know how to fetch data from various sources. And with Wikipedia being one of the largest and most popular sources for information on the Internet, this is a natural place […]

Read more

Concurrency in Python

Introduction Computing has evolved over time and more and more ways have come up to make computers run even faster. What if instead of executing a single instruction at a time, we can also execute several instructions at the same time? This would mean a significant increase in the performance of a system. Through concurrency, we can achieve this and our Python programs will be able to handle even more requests at a single time, and over time leading to […]

Read more

Multiple Linear Regression with Python

Introduction Linear regression is one of the most commonly used algorithms in machine learning. You’ll want to get familiar with linear regression because you’ll need to use it if you’re trying to measure the relationship between two or more continuous values. A deep dive into the theory and implementation of linear regression will help you understand this valuable machine learning algorithm. Defining Terms Before we delve into linear regression, let’s take a moment to make sure we are clear on […]

Read more

Building a Todo App with Flask in Python

Introduction In this tutorial, we are going to build an API, or a web service, for a todo app. The API service will be implemented using a REST-based architecture. Our app will have the following main features: Create an item in the todo list Read the complete todo list Update the items with status as “Not Started”, “In Progress”, or “Complete” Delete the items from the list What is REST? REST, or REpresentational State Transfer, is an architectural style for […]

Read more

Run-Length Encoding

In this article we’ll go over how the run-length encoding algorithm works, what it’s used for, and how to implement its encode and decode functions in Python. Run-length encoding (RLE) is a very simple form of data compression in which a stream of data is given as the input (i.e. “AAABBCCCC”) and the output is a sequence of counts of consecutive data values in a row (i.e. “3A2B4C”). This type of data compression is lossless, meaning that when decompressed, all […]

Read more

Introduction to OpenCV with Python

Introduction In this tutorial, we are going to learn how to use OpenCV library in Python. OpenCV is an open source library which is supported by multiple platforms including Windows, Linux, and MacOS, and is available for use in multiple other languages as well; however, it is most commonly used in Python for Machine Learning applications, specifically in the Computer Vision domain. Apart from its cross-platform support and availability in multiple other computer languages, which allows applications developed in it […]

Read more

Text Generation with Python and TensorFlow/Keras

Introduction Are you interested in using a neural network to generate text? TensorFlow and Keras can be used for some amazing applications of natural language processing techniques, including the generation of text. In this tutorial, we’ll cover the theory behind text generation using a Recurrent Neural Networks, specifically a Long Short-Term Memory Network, implement this network in Python, and use it to generate some text. Defining Terms To begin with, let’s start by defining our terms. It may prove difficult […]

Read more

Python for NLP: Creating a Rule-Based Chatbot

This is the 12th article in my series of articles on Python for NLP. In the previous article, I briefly explained the different functionalities of the Python’s Gensim library. Until now, in this series, we have covered almost all of the most commonly used NLP libraries such as NLTK, SpaCy, Gensim, StanfordCoreNLP, Pattern, TextBlob, etc. In this article, we are not going to explore any NLP library. Rather, we will develop a very simple rule-based chatbot capable of answering user […]

Read more
1 850 851 852 853 854 893