From be59149456aa985c9c632df528596e570066ee3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9lodie=20Boillet?= <boillet@teklia.com>
Date: Wed, 7 Jun 2023 16:33:05 +0200
Subject: [PATCH] Remove ununsed metrics functions

---
 dan/manager/metrics.py | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/dan/manager/metrics.py b/dan/manager/metrics.py
index 10ceeb11..0b2472d9 100644
--- a/dan/manager/metrics.py
+++ b/dan/manager/metrics.py
@@ -178,13 +178,6 @@ class MetricManager:
         return self.epoch_metrics[name]
 
 
-def keep_only_ner_tokens(str, tokens):
-    """
-    Remove all but ner tokens from string
-    """
-    return re.sub("([^" + tokens + "])", "", str)
-
-
 def keep_all_but_ner_tokens(str, tokens):
     """
     Remove all ner tokens from string
@@ -208,15 +201,6 @@ def nb_chars_cer_from_string(gt, layout_tokens=None):
     return len(format_string_for_cer(gt, layout_tokens))
 
 
-def edit_wer_from_string(gt, pred, layout_tokens=None, remove_punct=False):
-    """
-    Format and compute edit distance between two strings at word level
-    """
-    split_gt = format_string_for_wer(gt, layout_tokens, remove_punct)
-    split_pred = format_string_for_wer(pred, layout_tokens, remove_punct)
-    return edit_wer_from_formatted_split_text(split_gt, split_pred)
-
-
 def format_string_for_wer(str, layout_tokens, remove_punct=False):
     """
     Format string for WER computation: remove layout tokens, treat punctuation as word, replace line break by space
-- 
GitLab