See for yourself.
Insert a news headline into our search bar and get an evaluation from our headlines classifier.
Import packages
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
Import dataset
df = pd.read_csv("headlinesvolatilitydata.csv")
df.head(25)
Explore some data
df['titlesentimentoverall'].value_counts()
Set model specifications
spec = model_spec.get('average_word_vec')
Set parameters & train model
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)
Check model summary
model.summary()