MINHCT commited on
Commit
af31e8a
1 Parent(s): 192d8ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -14,6 +14,7 @@ vectorizer = joblib.load("vectorizer.joblib") # global vocabulary (used for Logi
14
  # Decode label function
15
  # {'business': 0, 'entertainment': 1, 'health': 2, 'politics': 3, 'sport': 4}
16
  def categorize(input_number):
 
17
  categories = {
18
  0: 'Business',
19
  1: 'Entertainment',
@@ -103,8 +104,11 @@ def categorize(url):
103
  return {"error_message": error}
104
 
105
  # Main App
106
- url = st.text_input("enter your CNN's URL here")
 
107
 
108
  if url:
109
- result = categorize(url)
 
 
110
  st.json(result)
 
14
  # Decode label function
15
  # {'business': 0, 'entertainment': 1, 'health': 2, 'politics': 3, 'sport': 4}
16
  def categorize(input_number):
17
+ print('receive label encoded', input_number)
18
  categories = {
19
  0: 'Business',
20
  1: 'Entertainment',
 
104
  return {"error_message": error}
105
 
106
  # Main App
107
+ url = st.text_input("enter your CNN's URL here"
108
+
109
 
110
  if url:
111
+ result = categorize(URL)
112
+ article_content = result.get('Article_Content')
113
+ st.text_area("Article Content", value=article_content, height=400) # render the article content as textarea element
114
  st.json(result)