Skip to content

Instantly share code, notes, and snippets.

@kiddojazz
Created April 28, 2024 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiddojazz/31f3485008f6b71a5491767d96bbfaed to your computer and use it in GitHub Desktop.
Save kiddojazz/31f3485008f6b71a5491767d96bbfaed to your computer and use it in GitHub Desktop.
#Business = 0, Entertainment = 1, Politics = 2, Sport = 3, Tech = 4
predict_input = loaded_tokenizer.encode(test_text,
truncation=True,
padding=True,
return_tensors="tf")
 
output = loaded_model(predict_input)[0]
 
prediction_value = tf.argmax(output, axis=1).numpy()[0]
prediction_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment