Introduction to Python Decorators

Introduction In Python, a decorator is a design pattern that we can use to add new functionality to an already existing object without the need to modify its structure. A decorator should be called directly before the function that is to be extended. With decorators, you can modify the functionality of a method, a function, or a class dynamically without directly using subclasses. This is a good idea when you want to extend the functionality of a function that you […]

Read more

Introduction to Python OS Module

In this tutorial, you will learn how to work along with Python’s os module. Table of Contents Introduction Basic Functions List Files / Folders in Current Working Directory Change working Directory Create Single and Nested Directory Structure Remove Single and Nested Directory Structure Recursively Example with Data Processing Conclusion Introduction Python is one of the most frequently used languages in recent times for various tasks such as data processing, data analysis, and website building. In this process, there are various […]

Read more

Python for NLP: Working with Text and PDF Files

This is the first article in my series of articles on Python for Natural Language Processing (NLP). In this article, we will start with the basics of Python for NLP. We will see how we can work with simple text files and PDF files using Python. Working with Text Files Text files are probably the most basic types of files that you are going to encounter in your NLP endeavors. In this section, we will see how to read from […]

Read more

Python for NLP: Tokenization, Stemming, and Lemmatization with SpaCy Library

In the previous article, we started our discussion about how to do natural language processing with Python. We saw how to read and write text and PDF files. In this article, we will start working with the spaCy library to perform a few more basic NLP tasks such as tokenization, stemming and lemmatization. Introduction to SpaCy The spaCy library is one of the most popular NLP libraries along with NLTK. The basic difference between the two libraries is the fact […]

Read more

Introduction to Python FTP

Introduction In this tutorial, we will explore how to use FTP with Python to send and receive files from a server over TCP/IP connections. To make things easier and more abstract, we will be using Python’s ftplib library which provides a range of functionalities that make it easier to work with FTP. We’ll see the implementation for uploading and downloading files from the server, as well as some other cool things that “ftplib” allows us to do. What is FTP? […]

Read more

Python for NLP: Vocabulary and Phrase Matching with SpaCy

This is the third article in this series of articles on Python for Natural Language Processing. In the previous article, we saw how Python’s NLTK and spaCy libraries can be used to perform simple NLP tasks such as tokenization, stemming and lemmatization. We also saw how to perform parts of speech tagging, named entity recognition and noun-parsing. However, all of these operations are performed on individual words. In this article, we will move a step further and explore vocabulary and […]

Read more

Basic AI Concepts: A* Search Algorithm

Introduction Artificial intelligence in its core strives to solve problems of enormous combinatorial complexity. Over the years, these problems were boiled down to search problems. A path search problem is a computational problem where you have to find a path from point A to point B. In our case, we’ll be mapping search problems to appropriate graphs, where the nodes represent all the possible states we can end up in and the edges representing all the possible paths that we […]

Read more

Commenting Python Code

Programming reflects your way of thinking in order to describe the single steps that you took to solve a problem using a computer. Commenting your code helps explain your thought process, and helps you and others to understand later on the intention of your code. This allows you to more easily find errors, to fix them, to improve the code later on, and to reuse it in other applications as well. Commenting is important to all kinds of projects, no […]

Read more

Python for NLP: Parts of Speech Tagging and Named Entity Recognition

This is the 4th article in my series of articles on Python for NLP. In my previous article, I explained how the spaCy library can be used to perform tasks like vocabulary and phrase matching. In this article, we will study parts of speech tagging and named entity recognition in detail. We will see how the spaCy library can be used to perform these two tasks. Parts of Speech (POS) Tagging Parts of speech tagging simply refers to assigning parts […]

Read more

Working with PostgreSQL in Python

Introduction PostgreSQL is one of the most advanced and widely used relational database management systems. It’s extremely popular for many reasons, a few of which include it being open source, its extensibility, and its ability to handle many different types of applications and varying loads. With Python, you can easily establish a connection to your PostgreSQL database. There are many Python drivers for PostgreSQL, with “psycopg” being the most popular one. Its current version is psycopg2. In this article, we’ll […]

Read more
1 875 876 877 878 879 922