Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollopy-tulane committed Apr 29, 2024
1 parent ee3b427 commit 59c2f81
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nlp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ def train_cnn():
except Exception as e:
print(f"Error loading model or tokenizer: {e}")

X_train = train_df["Comment_Adj"].apply(lambda x: cnn_process(x, tokenizer, maxlen=100))
X_val = val_df["Comment_Adj"].apply(lambda x: cnn_process(x, tokenizer, maxlen=100))

def process_with_tokenizer(text):
return cnn_process(text, tokenizer, maxlen=100)

X_train = train_df["Comment_Adj"].apply(process_with_tokenizer)
X_val = val_df["Comment_Adj"].apply(process_with_tokenizer)
predictions = cnn.predict(X_val)
predictions = (predictions > 0.5).astype(int)

Expand Down

0 comments on commit 59c2f81

Please sign in to comment.