How to invoke model.predict on this

Hello, I am new to AI/ML. I’m trying out this jupyter notebook, which trains a model for text classification using the OLID dataset:

text-classification/medium_building_a_text_classification_model_using_BiLSTM.ipynb at master · pashupati98/text-classification (

Everything works fine to the end, but I’m struggling to figure out how to call the model.predict on a sample text:

text = "this is a sample text from a tweet"

# how to transform text to a valid argument for model.predict ??


Any information will be appreciated.

It seems you need to extract glove vector for the text first using prepare_model_input function:

X_pred, _, _, _= prepare_model_input(pd.Series(“desired text”), pd.Series(“desired text”) )
y_pred = model.predict(X_pred)

1 Like