Map predictions to the correct topics if topics were reduced.
(self, predictions: List[int])
| 3899 | return documents |
| 3900 | |
| 3901 | def _map_predictions(self, predictions: List[int]) -> List[int]: |
| 3902 | """Map predictions to the correct topics if topics were reduced.""" |
| 3903 | mappings = self.topic_mapper_.get_mappings(original_topics=True) |
| 3904 | mapped_predictions = [mappings[prediction] if prediction in mappings else -1 for prediction in predictions] |
| 3905 | return mapped_predictions |
| 3906 | |
| 3907 | def _reduce_dimensionality( |
| 3908 | self, |