get topic info
Browse files
app.py
CHANGED
|
@@ -475,6 +475,7 @@ def base_bertopic(df):
|
|
| 475 |
try:
|
| 476 |
print(compute_coherence_value_bertopic(base_topic_model))
|
| 477 |
except:
|
|
|
|
| 478 |
print('Unable to generate meaningful topics (Base BERTopic model)')
|
| 479 |
|
| 480 |
def optimized_bertopic(df):
|
|
@@ -508,7 +509,7 @@ def optimized_bertopic(df):
|
|
| 508 |
index = df.isin([doc]).any(axis=1).idxmax()
|
| 509 |
# print(index)
|
| 510 |
tweets.append(df.loc[index, 'original_tweets'])
|
| 511 |
-
print(tweets)
|
| 512 |
top_tweets.append(tweets)
|
| 513 |
return top_tweets
|
| 514 |
|
|
|
|
| 475 |
try:
|
| 476 |
print(compute_coherence_value_bertopic(base_topic_model))
|
| 477 |
except:
|
| 478 |
+
print(base_topic_model.get_topic_info())
|
| 479 |
print('Unable to generate meaningful topics (Base BERTopic model)')
|
| 480 |
|
| 481 |
def optimized_bertopic(df):
|
|
|
|
| 509 |
index = df.isin([doc]).any(axis=1).idxmax()
|
| 510 |
# print(index)
|
| 511 |
tweets.append(df.loc[index, 'original_tweets'])
|
| 512 |
+
# print(tweets)
|
| 513 |
top_tweets.append(tweets)
|
| 514 |
return top_tweets
|
| 515 |
|