Hafizhzpa commited on
Commit
1a7e6e2
1 Parent(s): 4b53f10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -9,6 +9,8 @@ import requests
9
  from bs4 import BeautifulSoup
10
 
11
  class NewsAnalytic():
 
 
12
  @st.cache_resource
13
  def load_model(self):
14
  model = T5ForZeroShotClassification.from_pretrained('knowledgator/comprehend_it-multilingual-t5-base')
@@ -47,7 +49,6 @@ class NewsAnalytic():
47
  print("mendapatkan konten berita berhasil!")
48
  return {'title': title.strip(), 'content': content.strip()}
49
  def streamlit_run(self):
50
- self.classifier=self.load_model()
51
  st.markdown("<h2 style='text-align: center;'>Indonesian News Analytic </h2>", unsafe_allow_html=True)
52
  st.markdown("<p style='text-align: center;'>Hafizh Zaki Prasetyo Adi|[email protected]|https://www.linkedin.com/in/hafizhzpa/ </p>", unsafe_allow_html=True)
53
  part=st.sidebar.radio("input_type",["content", "link"],captions = ["input news content", "input news link"])
 
9
  from bs4 import BeautifulSoup
10
 
11
  class NewsAnalytic():
12
+ def __init__(self):
13
+ self.classifier=self.load_model()
14
  @st.cache_resource
15
  def load_model(self):
16
  model = T5ForZeroShotClassification.from_pretrained('knowledgator/comprehend_it-multilingual-t5-base')
 
49
  print("mendapatkan konten berita berhasil!")
50
  return {'title': title.strip(), 'content': content.strip()}
51
  def streamlit_run(self):
 
52
  st.markdown("<h2 style='text-align: center;'>Indonesian News Analytic </h2>", unsafe_allow_html=True)
53
  st.markdown("<p style='text-align: center;'>Hafizh Zaki Prasetyo Adi|[email protected]|https://www.linkedin.com/in/hafizhzpa/ </p>", unsafe_allow_html=True)
54
  part=st.sidebar.radio("input_type",["content", "link"],captions = ["input news content", "input news link"])