Update BERTopic/my_topic_modeling.py
Browse files
BERTopic/my_topic_modeling.py
CHANGED
|
@@ -504,10 +504,6 @@ def working(args: argparse.Namespace, name_dataset: str):
|
|
| 504 |
f.write(json.dumps(str(topic_keyword_weights),indent=4, ensure_ascii=False))
|
| 505 |
fandc_logger.log(logging.INFO, f'Save weights for each topic successfully!')
|
| 506 |
|
| 507 |
-
# Get coherence score
|
| 508 |
-
fandc_logger.log(logging.INFO, f'Staring calculate coherence score for {name_dataset} dataset')
|
| 509 |
-
coherence = coherence_score(topic_model, df_documents)
|
| 510 |
-
fandc_logger.log(logging.INFO, f'Coherence score for {name_dataset} dataset: {coherence} with {args.n_topics} topics')
|
| 511 |
|
| 512 |
# Put data into dataframe
|
| 513 |
df_topics = topic_model.get_document_info(df_documents)
|
|
|
|
| 504 |
f.write(json.dumps(str(topic_keyword_weights),indent=4, ensure_ascii=False))
|
| 505 |
fandc_logger.log(logging.INFO, f'Save weights for each topic successfully!')
|
| 506 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 507 |
|
| 508 |
# Put data into dataframe
|
| 509 |
df_topics = topic_model.get_document_info(df_documents)
|