Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -225,14 +225,14 @@ def format_emotions(emotion_counts):
|
|
| 225 |
})
|
| 226 |
return formatted_emotions
|
| 227 |
|
| 228 |
-
def process_and_summarize(df, bert_tokenizer, bert_model, emotion_classifier, top_n=50, topic_strategy="Auto", n_topics=None, min_topic_size=
|
| 229 |
"""Process the data and generate summaries with flexible topic configuration."""
|
| 230 |
summaries = []
|
| 231 |
|
| 232 |
topic_model_params = {
|
| 233 |
"language": "arabic",
|
| 234 |
"calculate_probabilities": True,
|
| 235 |
-
"min_topic_size":
|
| 236 |
"n_gram_range": (1, 1),
|
| 237 |
"top_n_words": 15,
|
| 238 |
"verbose": True,
|
|
@@ -398,7 +398,7 @@ if uploaded_file is not None:
|
|
| 398 |
top_n=top_n,
|
| 399 |
topic_strategy=topic_strategy,
|
| 400 |
n_topics=n_topics if topic_strategy == "Manual" else None,
|
| 401 |
-
min_topic_size=
|
| 402 |
)
|
| 403 |
|
| 404 |
if summaries:
|
|
|
|
| 225 |
})
|
| 226 |
return formatted_emotions
|
| 227 |
|
| 228 |
+
def process_and_summarize(df, bert_tokenizer, bert_model, emotion_classifier, top_n=50, topic_strategy="Auto", n_topics=None, min_topic_size=3):
|
| 229 |
"""Process the data and generate summaries with flexible topic configuration."""
|
| 230 |
summaries = []
|
| 231 |
|
| 232 |
topic_model_params = {
|
| 233 |
"language": "arabic",
|
| 234 |
"calculate_probabilities": True,
|
| 235 |
+
"min_topic_size": 3,
|
| 236 |
"n_gram_range": (1, 1),
|
| 237 |
"top_n_words": 15,
|
| 238 |
"verbose": True,
|
|
|
|
| 398 |
top_n=top_n,
|
| 399 |
topic_strategy=topic_strategy,
|
| 400 |
n_topics=n_topics if topic_strategy == "Manual" else None,
|
| 401 |
+
min_topic_size=3
|
| 402 |
)
|
| 403 |
|
| 404 |
if summaries:
|