The full release of Python 3.9 is out!
It’s clear that this version marks a breaking point from the old route of Python’s evolution, onto a new path. We’ll cover:
> Python's New Path
- Parser change
- Development cycles> New Features
- Type Hinting
- String Methods
- Dictionary Unions
Let’s explore these new features and understand where Python is heading.
There are two significant changes in this update, which we won’t see any immediate impact from — but we will begin to notice a slightly different evolution of Python as a language.
In short, this boils down…
GPT-3, BERT, XLNet, all of these are the current state of the art in natural language processing (NLP) — and all of them use a special architecture component called a Transformer.
Without a doubt, transformers are one of the biggest developments in AI in the past decade — bringing us ever closer to the unimaginable future of humanity.
Nonetheless, despite their popularity, transformers can seem confusing at first. Part of this seems to be because many ‘introductions’ to transformers miss the context that is just as important as understanding the transformer model architecture itself.
How can anyone be expected to grasp the concept of a transformer without first understanding attention and where attention came from? …
*All images used are by the author except where stated otherwise
Regular expressions are the de facto standard for parsing text. Every reputable programming language supports them, and almost every developer will need to use them at some point — they’re important.
The point of this article is to introduce regular expressions and work all the way through to some of the most interesting (and more advanced) features in RegEx — like look-ahead/behind assertions and conditionals.
If none of this had made any sense to you — don’t worry — we will start from the beginning.
In this Article> Common Metacharacters \d, \s…
Scheduling scripts can be an absolute necessity for a huge number of tasks. From data collection for AI to weekly blog newsletters, schedules are absolutely everywhere.
A significant portion of schedulable jobs is hosted on Linux machines and operated by Python scripts. Today, we will take a look at how we can automate script schedules using cron in Linux.
Note: The examples used here are specific to Fedora distributions (specifically CentOS). However, the process (minus the cron installation) is essentially the same for most other popular distributions as far as I am aware.
If something isn’t the same, let me know in the comments and I can update the article for others. …
The web runs on Linux, and we are currently living in the age of APIs. These two facts alongside Python being the most popular programming language in the world make knowing how to deploy a Python API via Linux an invaluable skill.
API development in Python is typically regulated to Django, Flask, or FastAPI, alongside a few other frameworks. The fastest of those for API development is the fittingly named FastAPI library.
In this article, we will produce a simply API with FastAPI — and learn how to deploy it on a Linux webserver (CentOS) using Uvicorn, Gunicorn, systemd, and (optionally) NGINX. …
2018 brought us a plethora of new features with the release of Python 3.7, followed by 3.8 in 2019, and 3.9 in 2020.
Many of those changes were behind the scenes. Optimizations and upgrades that the vast majority of us will never notice, despite their benefits.
Others are more obvious, additions to syntax or functionality that can change how we write our code. But even these visible changes can be hard to keep up with.
In this article, we will run through the more apparent upgrades to provide a brief but hopefully invaluable refresher on everything new to Python from the past few years. …
For anyone working with data (which — last I heard — is everyone), SQL is one of those skills that truly can move mountains. If SQL is used in your workplace, learning it can dramatically change your career for the better.
Although it is used everywhere, it can be expensive too. Many companies I’ve worked at or with used one of the following:
None of these are open-source, and all come with a hefty price tag. …
Automatic text summarization allows us to shorten long pieces of text into easy-to-read, short snippets that still convey the most important and relevant information of the original text.
In this article, we’ll build a simple but incredibly powerful text summarizer using Google’s T5. We’ll be using the PyTorch and Hugging Face’s Transformers frameworks.
This is split into three parts:
1. Import and Initialization
2. Data and Tokenization
3. Summary Generation
Check out the video version of this article here:
We need to import PyTorch and the AutoTokenizer
and AutoModelWIthLMHead
objects from the Transformers library:
import torch
from transformers import AutoTokenizer…
TensorFlow is one of the two titan frameworks in machine learning and data science. To operate effectively in either field, you need to become very familiar with TensorFlow or PyTorch — preferably both.
We will be focusing on the basics of TensorFlow in this article — there are no prerequisites other than an appetite to learn.
To be more specific, we will be speaking primarily about the high-level wrapper that we can call Keras. If you don’t know what that means, you will soon.
We will cover:
> TensorFlow and Keras> Functional v Sequential Approach
- Sequential
- Functional> Layered…
Language generation is one of those natural language tasks that can really produce an incredible feeling of awe at how far the fields of machine learning and artificial intelligence have come.
GPT-1, 2, and 3 are OpenAI’s top language models — well known for their ability to produce incredibly natural, coherent, and genuinely interesting language.
In this article, we will take a small snippet of text and learn how to feed that into a pre-trained GPT-2 model using PyTorch and Transformers to produce high-quality language generation in just eight lines of code. We cover:
> PyTorch and Transformers
- Data> Building the Model
- Initialization
- Tokenization
- Generation
…
About