Photo by Max LaRochelle on Unsplash

This is an introductory tutorial on how to conduct data analysis and visualization using a famous data analysis library called Pandas. Here is a quick summary of what will be covered in this tutorial:

  • installation of Python packages (requests, pandas, jupyter)
  • weather data collection (using the Tomorrow.io weather API)
  • data analysis (mean, min, max, std, etc.)
  • data visualization (bar plot, pie chart)

Setup

It is highly recommended to create a virtual environment before you continue. Activate it and run the following commands to install all the required dependencies:

Requests (optional)

We…


Step up your load testing game

dragonflies on a log
dragonflies on a log
Photo by Clément Falize on Unsplash

Previously, I have covered a beginner’s guide to Locust in Introduction to Locust: An Open Source Load Testing Tool in Python. In this article, let’s explore a little more with four useful advanced features that are available in Locust:

  • Execute tasks sequentially
  • Generate custom load shapes (time-based stages)
  • Use other custom clients
  • Run tasks in parallel

Let’s proceed to the next section and…


Another ASGI web server that supports HTTP/2 and HTTP/3 specifications

Image by the author

I have covered quite a number of tutorials on FastAPI in which servers are deployed with Uvicorn, a fast-lighting ASGI web server. At the time of this writing, Uvicorn currently only supports HTTP/1.1 and WebSockets. Based on the official documentation, support for HTTP/2 is planned but there is no estimation time on the completion.

HTTP/2 is a successor to the old HTTP/1 which comes with decrease latency while maintaining the same high-level semantics (methods, header fields, status codes, etc). Based on Wikipedia, it improves the loading of web pages via:


Utilizing khmer-nltk, an open-source NLP toolkit for Khmer

Photo by Paul Szewczyk on Unsplash

By reading this piece, you will learn to perform natural language processing task on Khmer language in Python. For your information, Khmer is the official language of Cambodia and used widely in Thailand (East and Northeast) and Vietnam (Mekong Delta).

Having a specialized language processing toolkit helps a lot when building any NLP related application which supports multiple languages. In this article, you will utilize an open-source library called. khmer-nltk. Based on the official documentation, khmer-nltk is a Khmer language processing toolkit build using conditional random fields.

At the time of this writing, it supports the following NLP tasks:

  • Sentence…


Photo by Fotis Fotopoulos on Unsplash

Profiling a python program is conducting a dynamic analysis that measures the program execution time — how much time the code takes to execute each program’s function. As functions and calls require too many resources, it is necessary to optimize them. And code optimization inevitably leads to cost optimization because it uses fewer CPU resources, which means paying less for the cloud infrastructure.

Developers often use varied approaches for local optimization. For example, they determine which function is quicker in executing the code. …


Train your own custom NER component to detect drug names

Photo by Myriam Zilles on Unsplash

Previously, I have covered an article on Sarcasm Text Classification using spaCy in Python. In this piece, you will learn more on the Named-Entity Recognition (NER) component instead.

For your information, NER is part of the NLP tasks for locating and classifying entities that are present in unstructured text into different categories. For example, given the following sentence:

John Doe bought 100 shares of Apple in 2020.
  • John Doe (PERSON)
  • Apple (ORGANIZATION)
  • 2020 (TIME)


One simple trick that works for all languages

Photo by Immo Wegmann on Unsplash

Speech-to-Text functionality has been gaining momentum recently as it offers a whole new user experience to users. It is being widely adopted by companies in the market especially in the customer services industry. In fact, big players such as Google and Microsoft provide their own Speech-to-Text API as part of their technologies.

For your information, most of the advanced Speech-to-Text APIs comes with word-level timestamps.

Google’s Speech-to-Text API

For example, you will get the following output when running Google’s Speech-to-Text API:

[
{
"startTime": "1.400s",
"endTime": "1.800s",
"word": "okay"
},
{
"startTime": "1.800s",
"endTime": "2.300s",
"word": "so"
},
...
]

Azure’s Speech-to-Text API

On the other…


Stream the file directly to a disk

App icons
App icons
Photo by Alexander Shatov on Unsplash.

Most of the time, a streaming response is the preferred choice when returning audio or video files from a server. This is mainly because streaming responses work really well for large files — especially those that exceed 1GB in file size.

In this tutorial, you will learn to:

  • Create a simple FastAPI server that returns an audio file via StreamingResponse.
  • Create a simple Python script to call the FastAPI server and save the response as a file directly to disk.

Setup

It is highly recommended to create a virtual…


Level up your documentation

Response example
Response example
Image by the author

By reading this article, you will learn to extend the documentation of FastAPI to include multiple examples for all the requests and responses. This works for both Swagger UI and ReDoc endpoints.

For example, you will be able to achieve the following result in ReDoc:


Hands-on Tutorials

Train your own custom TextCat component and package it as Python module

Photo by capnsnap on Unsplash

By reading this article, you will learn to train a sarcasm text classification model and deploy it in your Python application. Detecting the presence of sarcasm in text is a fun yet challenging natural language processing task.

This tutorial focuses mainly on training a custom multi-classification spaCy’s TextCat component. If you are just starting out or have your own use cases, all you need to do is to swap out the dataset with the one that you preferred. The setup and training process is more or less the same with some minor changes to the configuration.

To keep it simple…

Ng Wai Foong

Senior AI Engineer@Yoozoo | Content Writer #NLP #datascience #programming #machinelearning | Linkedin: https://www.linkedin.com/in/wai-foong-ng-694619185/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store