File size: 684 Bytes
818a838
 
e7e6566
818a838
 
 
 
 
bcfdcee
 
 
818a838
 
bcfdcee
 
 
 
 
 
e7e6566
bcfdcee
 
818a838
bcfdcee
818a838
e7e6566
 
 
818a838
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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)
  sentences = ["I am not having a great day"]
  model_outputs = classifier(sentences)
  st.write(model_outputs[0])