Skip to content

Commit

Permalink
acoustic: Add report level
Browse files Browse the repository at this point in the history
  • Loading branch information
revsic committed Feb 8, 2022
1 parent 84f2347 commit 101279f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions speeches/acoustic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Tuple
from typing import List, Optional, Tuple

import numpy as np

Expand All @@ -13,17 +13,21 @@ class AcousticDataset(SpeechSet):
"""
VOCABS = len(TextNormalizer.GRAPHEMES) + 1

def __init__(self, rawset: DataReader, config: Config):
def __init__(self,
rawset: DataReader,
config: Config,
report_level: Optional[int] = None):
"""Initializer.
Args:
rawset: file-format datum reader.
config: configuration.
report_level: text normalizing error report level.
"""
# cache dataset and preprocessor
super().__init__(rawset)
self.config = config
self.melstft = MelSTFT(config)
self.textnorm = TextNormalizer()
self.textnorm = TextNormalizer(report_level)

def normalize(self, text: str, speech: np.ndarray) \
-> Tuple[np.ndarray, np.ndarray]:
Expand Down

0 comments on commit 101279f

Please sign in to comment.