Spaces:
Sleeping
Sleeping
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 = ["I am not having a great day"] | |
model_outputs = classifier(sentences) | |
st.write(model_outputs[0]) | |