import streamlit as st import wna_googlenews as wna from transformers import pipeline st.title("WNA Google News App") st.subheader("Search for News") # create a dropdown menu for selecting days range days_range = st.selectbox("Select Days Range", ["1d", "7", "30d"]) query = st.text_input("Enter Query") settings = { "lang": "fr", "region": "FR", "period": days_range } classifier = pipeline(task="text-classification", model="SamLowe/roberta-base-go_emotions", top_k=None) if st.button("Search"): df = wna.get_news(settings, query) st.dataframe(df) # get each title colums sentences = df["title"] # convert into array sentences = sentences.tolist() st.write(sentences) model_outputs = classifier(sentences) st.write(model_outputs[0])