Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,9 @@ def analyze_text(text):
|
|
21 |
if not text:
|
22 |
return "Please enter some text."
|
23 |
|
|
|
|
|
|
|
24 |
# Summarization using Google Gemini AI
|
25 |
try:
|
26 |
prompt = f"Summarize this text:\n{text}"
|
@@ -48,6 +51,7 @@ def analyze_text(text):
|
|
48 |
**Sentiment:** {sentiment}
|
49 |
**Keywords:** {', '.join(keywords)}
|
50 |
**Entities:** {entities if entities else 'None'}
|
|
|
51 |
"""
|
52 |
|
53 |
return report
|
@@ -70,4 +74,4 @@ with gr.Blocks() as demo:
|
|
70 |
|
71 |
analyze_button.click(process_input, inputs=[input_text, file_input], outputs=output)
|
72 |
|
73 |
-
demo.launch()
|
|
|
21 |
if not text:
|
22 |
return "Please enter some text."
|
23 |
|
24 |
+
# Word Count
|
25 |
+
word_count = len(text.split())
|
26 |
+
|
27 |
# Summarization using Google Gemini AI
|
28 |
try:
|
29 |
prompt = f"Summarize this text:\n{text}"
|
|
|
51 |
**Sentiment:** {sentiment}
|
52 |
**Keywords:** {', '.join(keywords)}
|
53 |
**Entities:** {entities if entities else 'None'}
|
54 |
+
**Word Count:** {word_count}
|
55 |
"""
|
56 |
|
57 |
return report
|
|
|
74 |
|
75 |
analyze_button.click(process_input, inputs=[input_text, file_input], outputs=output)
|
76 |
|
77 |
+
demo.launch()
|