Skip to content

Commit

Permalink
Import CNN
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollopy-tulane committed Apr 29, 2024
1 parent 8bf4edb commit 4b83847
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nlp/app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ def index():
proba = probas[0, pred]
elif model_choice == 'cnn':
# For CNN, assuming preprocessing is handled differently or is built-in
model_path = '/Users/jackiecollopy/Downloads/project-reddit/nlp/cnn_model.h5'
model = load_model(model_path, compile=False)
text = basic_process(input_field)
text = cnn_process(text)
predictions_proba = cnn.predict(text)
predictions_proba = model.predict(text)
pred = (predictions_proba > 0.5).astype(int)
proba = predictions_proba[0]
elif model_choice == 'bert':
Expand Down

0 comments on commit 4b83847

Please sign in to comment.