Update BERTopic/my_topic_modeling.py
Browse files
BERTopic/my_topic_modeling.py
CHANGED
|
@@ -171,6 +171,15 @@ def init_args():
|
|
| 171 |
required=True,
|
| 172 |
help="Only train both models for calculating coherence score.",
|
| 173 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
args = parser.parse_args()
|
| 176 |
|
|
@@ -559,7 +568,7 @@ def working(args: argparse.Namespace, name_dataset: str):
|
|
| 559 |
|
| 560 |
# ****** 2
|
| 561 |
# Get reduce topics and topic over time for each n_topics
|
| 562 |
-
if args.
|
| 563 |
fandc_logger.log(logging.INFO, f'Staring reduce topics and topic over time from 10 to 50...')
|
| 564 |
for n_topics in [10,20,30,40,50]:
|
| 565 |
topic_model_copy = copy.deepcopy(topic_model)
|
|
|
|
| 171 |
required=True,
|
| 172 |
help="Only train both models for calculating coherence score.",
|
| 173 |
)
|
| 174 |
+
|
| 175 |
+
parser.add_argument(
|
| 176 |
+
"--need_reduce_n_topics",
|
| 177 |
+
default="yes",
|
| 178 |
+
type=str,
|
| 179 |
+
required=True,
|
| 180 |
+
help="Need reduce n topics and show topic modeling over timestamp with this.",
|
| 181 |
+
)
|
| 182 |
+
|
| 183 |
|
| 184 |
args = parser.parse_args()
|
| 185 |
|
|
|
|
| 568 |
|
| 569 |
# ****** 2
|
| 570 |
# Get reduce topics and topic over time for each n_topics
|
| 571 |
+
if args.need_reduce_n_topics == 'yes':
|
| 572 |
fandc_logger.log(logging.INFO, f'Staring reduce topics and topic over time from 10 to 50...')
|
| 573 |
for n_topics in [10,20,30,40,50]:
|
| 574 |
topic_model_copy = copy.deepcopy(topic_model)
|