Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ if st.button("Process"):
|
|
| 31 |
summary = summarizer(text_input, max_length=130, min_length=30, do_sample=False)
|
| 32 |
summarized_text = summary[0]['summary_text']
|
| 33 |
# Display the summary result
|
| 34 |
-
st.write("
|
| 35 |
except Exception as e:
|
| 36 |
st.error(f"Error during summarization: {e}")
|
| 37 |
|
|
@@ -40,7 +40,6 @@ if st.button("Process"):
|
|
| 40 |
results = classifier(summarized_text)[0]
|
| 41 |
# Find the category with the highest score
|
| 42 |
max_score = max(results, key=lambda x: x['score'])
|
| 43 |
-
st.write("Summarized Text:", summarized_text)
|
| 44 |
st.write("Category:", max_score['label'])
|
| 45 |
st.write("Score:", max_score['score'])
|
| 46 |
except Exception as e:
|
|
|
|
| 31 |
summary = summarizer(text_input, max_length=130, min_length=30, do_sample=False)
|
| 32 |
summarized_text = summary[0]['summary_text']
|
| 33 |
# Display the summary result
|
| 34 |
+
st.write("Summarized Text:", summarized_text)
|
| 35 |
except Exception as e:
|
| 36 |
st.error(f"Error during summarization: {e}")
|
| 37 |
|
|
|
|
| 40 |
results = classifier(summarized_text)[0]
|
| 41 |
# Find the category with the highest score
|
| 42 |
max_score = max(results, key=lambda x: x['score'])
|
|
|
|
| 43 |
st.write("Category:", max_score['label'])
|
| 44 |
st.write("Score:", max_score['score'])
|
| 45 |
except Exception as e:
|