(self, doc: dict, results: float)
| 1456 | ) |
| 1457 | |
| 1458 | def process_results(self, doc: dict, results: float) -> dict: |
| 1459 | (loglikelihood,) = results |
| 1460 | words = self.count_words(self.doc_to_target(doc)) |
| 1461 | bytes_ = self.count_bytes(self.doc_to_target(doc)) |
| 1462 | return { |
| 1463 | "word_perplexity": (loglikelihood, words), |
| 1464 | "byte_perplexity": (loglikelihood, bytes_), |
| 1465 | "bits_per_byte": (loglikelihood, bytes_), |
| 1466 | } |
| 1467 | |
| 1468 | def aggregation(self) -> dict: |
| 1469 | return { |
nothing calls this directly
no test coverage detected