From c9364d6ab925e750022063b21a8554c8b07c2a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tanel=20Alum=C3=A4e?= Date: Mon, 11 Apr 2022 15:52:21 +0300 Subject: [PATCH] info statements to debug --- lid.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lid.py b/lid.py index 295b299..472d56b 100644 --- a/lid.py +++ b/lid.py @@ -22,17 +22,17 @@ def get_language_probs(self, buffer): return softm def get_language(self, buffer): - logging.info("Doing LID") + logging.debug("Doing LID") probs = self.get_language_probs(buffer) - logging.info(f"Original prob for languge {self.target_language}: {probs[self.target_language_id]:.2f}") + logging.debug(f"Original prob for languge {self.target_language}: {probs[self.target_language_id]:.2f}") priors0 = torch.ones(len(probs), requires_grad=False) / len(probs) true_priors = (torch.ones(len(probs), requires_grad=False) - self.target_prior) / (len(probs) - 1) true_priors[self.target_language_id] = self.target_prior numerator = true_priors/priors0 * probs corrected_probs = numerator / numerator.sum() - logging.info(f"Corrected prob for languge {self.target_language}: {corrected_probs[self.target_language_id]:.2f}") + logging.debug(f"Corrected prob for languge {self.target_language}: {corrected_probs[self.target_language_id]:.2f}") language_id = corrected_probs.argmax() - logging.info(f"Detected language: {self.languages[language_id]}: {corrected_probs[language_id]:.2f}") + logging.debug(f"Detected language: {self.languages[language_id]}: {corrected_probs[language_id]:.2f}") return language_id def filter(self, chunk_generator):