Ahmad-Moiz commited on
Commit
d50e4bc
Β·
1 Parent(s): 6be22aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -15
app.py CHANGED
@@ -66,7 +66,7 @@ def generate_summary(article, top_n=5):
66
 
67
  # Set page configuration and styles
68
  st.set_page_config(page_title="Article Summarizer", page_icon="✍️")
69
- st.title("We summarize and translate your articles")
70
 
71
  st.markdown(
72
  """
@@ -87,14 +87,6 @@ st.markdown(
87
  }
88
  .stText {
89
  color: #333;
90
- font-size: 16px; /* Adjust font size as needed */
91
- }
92
- .stCheckbox span {
93
- font-size: 18px; /* Adjust font size as needed */
94
- }
95
- .stMarkdown h1 {
96
- font-size: 24px; /* Adjust font size as needed */
97
- font-weight: bold;
98
  }
99
  </style>
100
  """,
@@ -102,18 +94,18 @@ st.markdown(
102
  )
103
 
104
  # Input text area
105
- user_article = st.text_area("βœ’οΈ **Enter your article here:**", height=100, key="user_article")
106
 
107
  # Translation options
108
- translate = st.checkbox("🌐 **Translate Summary**", key="translate_checkbox")
109
  if translate:
110
- target_language = st.selectbox("🌎 **Select Target Language**", ["πŸ‡ΊπŸ‡Έ English", "πŸ‡«πŸ‡· French", "πŸ‡ͺπŸ‡Έ Spanish", "πŸ‡©πŸ‡ͺ German"], key="target_language")
111
 
112
  # Summarize button
113
  if st.button("Summarize"):
114
  if user_article:
115
  summary = generate_summary(user_article)
116
- st.subheader("πŸ“„ **Summary:**")
117
  st.write(summary)
118
 
119
  # Translation logic
@@ -129,7 +121,7 @@ if st.button("Summarize"):
129
 
130
  translator = Translator()
131
  translated_summary = translator.translate(summary, dest=target_language_code)
132
- st.subheader("🌐 **Translated Summary:**")
133
  st.write(translated_summary.text)
134
  else:
135
- st.warning("🚫 **Please enter an article to summarize.**")
 
66
 
67
  # Set page configuration and styles
68
  st.set_page_config(page_title="Article Summarizer", page_icon="✍️")
69
+ st.title("We sumerize and translate your articles")
70
 
71
  st.markdown(
72
  """
 
87
  }
88
  .stText {
89
  color: #333;
 
 
 
 
 
 
 
 
90
  }
91
  </style>
92
  """,
 
94
  )
95
 
96
  # Input text area
97
+ user_article = st.text_area("βœ’οΈ Enter your article here:", height=100)
98
 
99
  # Translation options
100
+ translate = st.checkbox("🌐 Translate Summary")
101
  if translate:
102
+ target_language = st.selectbox("🌎 Select Target Language", ["πŸ‡ΊπŸ‡Έ English", "πŸ‡«πŸ‡· French", "πŸ‡ͺπŸ‡Έ Spanish", "πŸ‡©πŸ‡ͺ German"])
103
 
104
  # Summarize button
105
  if st.button("Summarize"):
106
  if user_article:
107
  summary = generate_summary(user_article)
108
+ st.subheader("πŸ“„ Summary:")
109
  st.write(summary)
110
 
111
  # Translation logic
 
121
 
122
  translator = Translator()
123
  translated_summary = translator.translate(summary, dest=target_language_code)
124
+ st.subheader("🌐 Translated Summary:")
125
  st.write(translated_summary.text)
126
  else:
127
+ st.warning("🚫 Please enter an article to summarize.")