News headlines are some of the most volatile and consumed pieces of information on the planet. We have made a headlines classifier to help users determine when headlines are junking up their content consumption ecosystem. We have also made it open-source so users can see how it works and operates. Our dataset is open-source and freely available.
Check out our demo and/or codebook
Models available for testing purposes only https://raw.githubusercontent.com/CuratedNews/headlinesclassifier/main/headlinesclassifier.tflite & https://raw.githubusercontent.com/CuratedNews/headlinesclassifier/main/headlinesclassifier2.tflite
!pip install -q tflite-model-maker-nightly
import pandas as pd
from tflite_model_maker import model_spec
from tflite_model_maker import text_classifier
from tflite_model_maker.text_classifier import DataLoader
df = pd.read_csv("headlinesvolatilitydata.csv")
df.head(25)
df['titlesentimentoverall'].value_counts()
spec = model_spec.get('average_word_vec')
for more information on text classification specifications see tensorflow docs
train_data = DataLoader.from_csv(
filename='headlinesvolatilitydata.csv',
text_column='title',
label_column='titlesentimentoverall',
model_spec=spec,
is_training=True)
model = text_classifier.create(train_data, model_spec=spec, epochs=10)
model.summary()
Check our demo for a hands-on with explanations
Do it yourself
Visit https://curatednews.xyz