Skip to main content

Package to classify aviation safety hazards from FAA Service Difficulty Reports data

Project description

Service Difficult Report (SDR) hazards classification package

:rocket: This is the source code for the SDR Classifier package that classifies potential aviation safety hazards from textual data. The work is a collaboration between FAA and Boeing data scientist teams

Version 0.1.0 out now! Check out the release notes here.

tests Current Release Version pypi Version Python wheels PyPi downloads Boeing on Twitter

Demo

Virtual Environment

It is highly recommended to use venv, virtualenv or conda python environments. Read more about creating virtual environments via venv https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments

Build and pip install the whl file locally

Run the command in the root folder to create the whl file in the dist folder

git clone https://github.com/Boeing/sdr-hazards-classification
python setup.py bdist_wheel
pip install ./distr/sdr_hazards_classification-0.1.0-py3-none-any.whl

Install sdr_hazards_classification from Pypi with pip

pip install sdr_hazards_classification

Example

:airplane: Follow the code snippet below to test and call the prediction method from the Depressurization model

from sdr_hazards_classification import sdr_api
import pandas as pd

my_model = sdr_api.SdrInferenceAPI()

#test the prediction method
my_model.test_sdr_depressurization_predictions()

event_text = "Lost cabin pressurization at flight level 30000, cabin altitude warning horn sounded at 10000 feet. Unabel to control cabin pressure with outflow valve closed"
pred, probs = my_model.get_predictions([event_text])

df = pd.read_csv('./src/sdr_classifier/data/SDR_Example.csv')
records = df["Text"]
#pass in a record list for prediction
pred, probs = my_model.get_predictions(records)

df['Prediction'] = pred
df['Prob'] = probs

print(df.head(2))

print("Done")

Contributing

🛩️ Please follow the contribution guideline

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdr-hazards-classification-0.1.1.tar.gz (7.8 MB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page