Update app.py
Browse files
app.py
CHANGED
|
@@ -76,20 +76,23 @@ def main():
|
|
| 76 |
if 'summary' not in st.session_state:
|
| 77 |
st.session_state.summary=True
|
| 78 |
st.session_state.summarization = summ
|
|
|
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
translate = st.sidebar.radio('Do you want to translate the text to any different language?', ('No', 'Yes'))
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
if translate == 'Yes' and gen_summ == True:
|
| 85 |
lang_list = ['Hindi', 'Marathi', 'Malayalam', 'Kannada', 'Telugu', 'Tamil', 'Oriya', 'Bengali', 'Gujarati', 'Urdu']
|
| 86 |
|
| 87 |
s_type = st.sidebar.selectbox('Select the Language in which you want to Translate:',lang_list)
|
| 88 |
st.sidebar.write('You selected:', s_type)
|
| 89 |
|
| 90 |
-
|
| 91 |
-
summarized_text = st.session_state.summarization
|
| 92 |
-
st.write(summarized_text)
|
| 93 |
translation = get_translation(source='English', dest=s_type, text=summarized_text)
|
| 94 |
|
| 95 |
st.sidebar.write(translation)
|
|
@@ -101,4 +104,4 @@ def main():
|
|
| 101 |
|
| 102 |
if __name__ == '__main__':
|
| 103 |
|
| 104 |
-
main()
|
|
|
|
| 76 |
if 'summary' not in st.session_state:
|
| 77 |
st.session_state.summary=True
|
| 78 |
st.session_state.summarization = summ
|
| 79 |
+
st.session_state.gen_summ = True
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
translate = st.sidebar.radio('Do you want to translate the text to any different language?', ('No', 'Yes'))
|
| 84 |
+
if 'summary' in st.session_state:
|
| 85 |
+
summarized_text = st.session_state.summarization
|
| 86 |
+
st.write(summarized_text)
|
| 87 |
+
gen_summ = st.session_state.gen_summ
|
| 88 |
+
|
| 89 |
if translate == 'Yes' and gen_summ == True:
|
| 90 |
lang_list = ['Hindi', 'Marathi', 'Malayalam', 'Kannada', 'Telugu', 'Tamil', 'Oriya', 'Bengali', 'Gujarati', 'Urdu']
|
| 91 |
|
| 92 |
s_type = st.sidebar.selectbox('Select the Language in which you want to Translate:',lang_list)
|
| 93 |
st.sidebar.write('You selected:', s_type)
|
| 94 |
|
| 95 |
+
|
|
|
|
|
|
|
| 96 |
translation = get_translation(source='English', dest=s_type, text=summarized_text)
|
| 97 |
|
| 98 |
st.sidebar.write(translation)
|
|
|
|
| 104 |
|
| 105 |
if __name__ == '__main__':
|
| 106 |
|
| 107 |
+
main()
|