SCANSKY commited on
Commit
e4797c9
·
verified ·
1 Parent(s): a963050

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +2 -1
handler.py CHANGED
@@ -1,4 +1,5 @@
1
  import json
 
2
  from bertopic import BERTopic
3
 
4
  class EndpointHandler:
@@ -46,7 +47,7 @@ class EndpointHandler:
46
  customlabels = self.topic_model.custom_labels_
47
 
48
  distributedtopics = [
49
- [f"Topic {topic_idx}", customlabels[topic_idx + 1], f"{contribution * 100}%"]
50
  for topic_idx, contribution in ranked_topics
51
  ]
52
  # Prepare the results
 
1
  import json
2
+
3
  from bertopic import BERTopic
4
 
5
  class EndpointHandler:
 
47
  customlabels = self.topic_model.custom_labels_
48
 
49
  distributedtopics = [
50
+ [f"Topic {topic_idx}", customlabels[topic_idx + 1], f"{round(contribution * 100, 2)}%"]
51
  for topic_idx, contribution in ranked_topics
52
  ]
53
  # Prepare the results