Boarding Pass OCR

This article walks you through the building process of an OCR API that extracts data from Flight Boarding Passes using our deep learning engine. It will work for any airline company or boarding pass template.

Prerequisites

  1. You’ll need a free account. Sign up and confirm your email to login.
  2. You’ll need at least 20 Boarding Pass images or PDFs to train your OCR.

Define your Boarding Pass use case

First, we’re going to define the fields we'd like to extract from a Boarding Pass.

Boarding pass key data extraction

  • Passenger name: The full name of the travelling passenger (John Doe)
  • Flight number: The flight number for the boarding pass, including the airline's identification letters (AC 2505)
  • Date: The date of departure in US format (10/12/2017)
  • Departure airport: The airport of departure including the airport identification letters (New Delhi DEL)
  • Destination airport: The airport of destination including the airport identification letters (Los Angeles LAX)
  • Boarding Time: The boarding time (07:45)

That’s it for our use case. Feel free to add any other relevant data to fit your requirements.

Deploy your API

Once you have defined the list of fields you want to extract, head over to the platform and press the ‘create a new API’ button.

You land now on the setup page. Here is the image you can use to set up the API. For instance, my setup is as follows:

Set up your API

Once you’re ready, press the “next” button, and let's specify the data types for each of the fields we want our API to extract.

To move forward, you have two possibilities:

Upload a json config
Copy the following JSON into a file and upload it on the interface

{
  "problem_type": {
    "classificator": { "features": [], "features_name": [] },
    "selector": {
      "features": [
        {
          "cfg": { "filter": { "alpha": -1, "numeric": 0 } },
          "handwritten": false,
          "name": "passenger_name",
          "public_name": "Passenger Name",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "alpha": -1, "numeric": -1 } },
          "handwritten": false,
          "name": "flight_number",
          "public_name": "Flight number",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "convention": "US" } },
          "handwritten": false,
          "name": "date",
          "public_name": "Date",
          "semantics": "date"
        },
        {
          "cfg": { "filter": { "alpha": -1, "numeric": 0 } },
          "handwritten": false,
          "name": "departure_airport",
          "public_name": "Departure airport",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "alpha": -1, "numeric": 0 } },
          "handwritten": false,
          "name": "destination_airport",
          "public_name": "Destination airport",
          "semantics": "word"
        },
        {
          "cfg": { "filter": { "alpha": 0, "numeric": -1 } },
          "handwritten": false,
          "name": "boarding_time",
          "public_name": "Boarding Time",
          "semantics": "word"
        }
      ],
      "features_name": [
        "passenger_name",
        "flight_number",
        "date",
        "departure_airport",
        "destination_airport",
        "boarding_time"
      ]
    }
  }
}

Or build your data model manually
Using the interface, add up to your data model each field.

Build manually your data model

Passenger name: type String that never contains numeric characters.
Flight number: type String without specifications.
Date: type Date with US format order.
Departure airport: type String that never contains numeric characters.
Destination airport: type String that never contains numeric characters.
Boarding Time: type String that never contains alpha characters

Once you’re done setting up your data model, press the Start training your model button at the bottom of the screen.

Data model ready

Train your Boarding Pass OCR model

Data model training

Now is the time to train your Boarding Pass deep learning model in the Training section of your API.

In a few hours (minutes if you're expeditious), you’ll get your first model trained and will be able to use your custom OCR API for parsing Boarding Passes in your application.

To get more information about the training phase, please refer to the Getting Started tutorial.

If you have any questions regarding your use case, feel free to reach out on the chat!

Updated 28 days ago


Boarding Pass OCR


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.