Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanenguyen authored Dec 19, 2023
1 parent 861fd26 commit 4e9beec
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,24 @@ pip install sdr_hazards_classification
:airplane: Follow the code snippet below to test and call the prediction method from the Depressurization model

```
from sdr_hazards_classification import sdr_api
from sdr_hazards_classification.sdr_api import SdrInferenceAPI, CORROSION_LIMIT, DEGRADED_CONTROLLABILITY
import pandas as pd
my_model = sdr_api.SdrInferenceAPI()
depressurization_model = sdr_api.SdrInferenceAPI()
#test the prediction method
my_model.test_sdr_depressurization_predictions()
depressurization_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])
pred, probs = depressurization_model.get_predictions([event_text])
degraded_controllability_model = SdrInferenceAPI(DEGRADED_CONTROLLABILITY)
degraded_controllability_model.test_sdr_degraded_controllability()
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)
pred, probs = depressurization_model.get_predictions(records)
df['Prediction'] = pred
df['Prob'] = probs
Expand Down

0 comments on commit 4e9beec

Please sign in to comment.