Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -43,16 +43,24 @@ def process_company(company_name):
|
|
43 |
translator = get_translator()
|
44 |
if translator:
|
45 |
try:
|
46 |
-
#
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
# Generate Hindi audio
|
53 |
tts_converter = TextToSpeechConverter()
|
54 |
audio_path = tts_converter.generate_audio(
|
55 |
-
|
56 |
f'{company_name}_summary'
|
57 |
)
|
58 |
data['audio_path'] = audio_path
|
|
|
43 |
translator = get_translator()
|
44 |
if translator:
|
45 |
try:
|
46 |
+
# Create a more detailed Hindi explanation
|
47 |
+
sentiment_explanation = f"""
|
48 |
+
{company_name} के समाचारों का विश्लेषण:
|
49 |
+
|
50 |
+
समग्र भावना: {data['final_sentiment_analysis']}
|
51 |
+
|
52 |
+
भावनात्मक विश्लेषण:
|
53 |
+
- सकारात्मक भावना: {data.get('comparative_sentiment_score', {}).get('sentiment_indices', {}).get('positivity_index', 0):.2f}
|
54 |
+
- नकारात्मक भावना: {data.get('comparative_sentiment_score', {}).get('sentiment_indices', {}).get('negativity_index', 0):.2f}
|
55 |
+
- भावनात्मक तीव्रता: {data.get('comparative_sentiment_score', {}).get('sentiment_indices', {}).get('emotional_intensity', 0):.2f}
|
56 |
+
|
57 |
+
विश्वसनीयता स्कोर: {data.get('comparative_sentiment_score', {}).get('sentiment_indices', {}).get('confidence_score', 0):.2f}
|
58 |
+
"""
|
59 |
|
60 |
# Generate Hindi audio
|
61 |
tts_converter = TextToSpeechConverter()
|
62 |
audio_path = tts_converter.generate_audio(
|
63 |
+
sentiment_explanation,
|
64 |
f'{company_name}_summary'
|
65 |
)
|
66 |
data['audio_path'] = audio_path
|