This is a machine learning algorithm written in python using Tensorflow that predicts the givens headline category. This has been trained on the BBC-text.csv data that you can find here http://mlg.ucd.ie/datasets/bbc.html.
Try this code out for your self and see if you can improve on my predictions below : Model Predicted : Boeing 737 Max sees first firm order since crashes Actual Category : business Predicated Category : tech
Model Predicted : Google fired employees for union activity, says US agency
Actual Category : tech
Predicated Category : tech
Model Predicted : The UAE and Israels whirlwind honeymoon has gone beyond normalization
Actual Category : politics
Predicated Category : sport
Model Predicted : Why Donald Trump keeps outperforming the polls
Actual Category : politics
Predicated Category : entertainment
Model Predicted : Self-driving robotaxis are taking off in China
Actual Category : tech
Predicated Category : sport
Model Predicted : Why some food brands want you to know their climate impact
Actual Category : business
Predicated Category : entertainment
You can start with the following to improve ,choose a better optimizer ,choose a better activation for the output node or change the structure of the Sequential model.