This device is not compatible.


Classify an Aeronautical Message (NOTAM) Using OpenAI ChatGPT

In this project, we’ll learn how we can use ChatGPT to classify Notices to Airmen (NOTAMs) messages and embed such a methodology into a function that can further be deployed as an API.

Classify an Aeronautical Message (NOTAM) Using OpenAI ChatGPT

You will learn to:

Understand ChatGPT as a text classification engine.

Understand how prompts influence the result of a ChatGPT request.

Embed ChatGPT programmatically into Python code.

Classify NOTAM messages into predefined categories.


Machine Learning

Prompt Engineering

API Integration


Basic understanding of NOTAM and how messages are constructed

Basic understanding of OpenAI ChatGPT

Paid subscription to OpenAI API

Basic understanding of Python




Project Description

Classification of human-written messages into predefined categories is a problem every programmer or data scientist faces at some point in their career. These tasks are typically dealt with by extracting keywords out of a sample of messages such as social media posts or titles of books, and then mapping such keywords to categories. With the arrival of ChatGPT, these tasks can be approached in a totally different manner.

ChatGPT can be used as an expert, meaning we can give ChatGPT the created categories and then provide ChatGPT with a message and ask which of the categories would best fit this message. Finally, we can ask ChatGPT to structure the response in a structured format such as JSON. All of this can be done using a Python function.

In this project, we’ll explore such an example using Notices to Airmen (NOTAMs) messages issued by air traffic controllers to pilots as a source. The same approach can be taken on any other human-created message.

Project Tasks



Task 0: Get Started

Task 1: Set Up OpenAI API Key


Basic Prompt Engineering

Task 2: Build a ChatGPT Request Function

Task 3: Verify the Forgetfulness of ChatGPT


The Shirt Size Selection Scenario

Task 4: Build a Shirt Size Selection Request

Task 5: Format the Input

Task 6: Format the Output

Task 7: Build a Classification Function


Classifying NOTAMs

Task 8: Summarize a NOTAM Message Using ChatGPT

Task 9: Set Up the NOTAM Classification Prompt

Task 10: Add Rationales as Output

Task 11: Build a NOTAM Classification Function