From 50ef94b68c495f610810083960b1e62b09c9fff8 Mon Sep 17 00:00:00 2001 From: co63oc Date: Fri, 21 Mar 2025 14:38:53 +0800 Subject: [PATCH] Fix typos (#4024) * Fix * Fix --- audio/paddleaudio/compliance/kaldi.py | 6 +++--- audio/paddleaudio/compliance/librosa.py | 2 +- examples/aishell/asr3/cmd.sh | 4 ++-- examples/librispeech/asr1/cmd.sh | 4 ++-- examples/librispeech/asr2/cmd.sh | 4 ++-- examples/librispeech/asr3/cmd.sh | 4 ++-- examples/librispeech/asr4/cmd.sh | 4 ++-- examples/librispeech/asr5/cmd.sh | 4 ++-- examples/mustc/st1/cmd.sh | 4 ++-- examples/other/ngram_lm/s0/local/kenlm_score_test.py | 2 +- examples/ted_en_zh/st1/cmd.sh | 4 ++-- paddlespeech/dataset/aidatatang_200zh/aidatatang_200zh.py | 2 +- paddlespeech/dataset/aishell/aishell.py | 4 ++-- paddlespeech/s2t/utils/error_rate.py | 2 +- paddlespeech/t2s/frontend/zh_frontend.py | 2 +- paddlespeech/t2s/utils/error_rate.py | 2 +- .../engine/asr/decoder/ctc_prefix_beam_search_decoder.cc | 4 ++-- runtime/engine/common/frontend/cmvn.cc | 2 +- runtime/engine/common/frontend/cmvn.h | 2 +- runtime/engine/common/frontend/db_norm.h | 2 +- runtime/engine/common/matrix/kaldi-matrix.cc | 8 ++++---- runtime/engine/common/matrix/kaldi-vector.cc | 2 +- runtime/engine/common/utils/file_utils.cc | 2 +- runtime/engine/kaldi/lat/kaldi-lattice.cc | 2 +- runtime/examples/README.md | 2 +- runtime/examples/audio_classification/README.md | 6 +++--- runtime/examples/text_lm/local/mmseg.py | 1 - runtime/patch/openfst/src/include/fst/flags.h | 4 ++-- tests/test_tipc/conformer/scripts/aishell_tiny.py | 2 +- tests/unit/cli/aishell_test_prepare.py | 2 +- tests/unit/tts/test_snapshot.py | 2 +- tools/extras/install_liblbfgs.sh | 2 +- utils/format_triplet_data.py | 2 +- utils/tokenizer.perl | 2 +- 34 files changed, 51 insertions(+), 52 deletions(-) diff --git a/audio/paddleaudio/compliance/kaldi.py b/audio/paddleaudio/compliance/kaldi.py index a94ec4053..d2184ebe3 100644 --- a/audio/paddleaudio/compliance/kaldi.py +++ b/audio/paddleaudio/compliance/kaldi.py @@ -233,7 +233,7 @@ def spectrogram(waveform: Tensor, round_to_power_of_two (bool, optional): If True, round window size to power of two by zero-padding input to FFT. Defaults to True. sr (int, optional): Sample rate of input waveform. Defaults to 16000. - snip_edges (bool, optional): Drop samples in the end of waveform that cann't fit a signal frame when it + snip_edges (bool, optional): Drop samples in the end of waveform that can't fit a signal frame when it is set True. Otherwise performs reflect padding to the end of waveform. Defaults to True. subtract_mean (bool, optional): Whether to subtract mean of feature files. Defaults to False. window_type (str, optional): Choose type of window for FFT computation. Defaults to "povey". @@ -443,7 +443,7 @@ def fbank(waveform: Tensor, round_to_power_of_two (bool, optional): If True, round window size to power of two by zero-padding input to FFT. Defaults to True. sr (int, optional): Sample rate of input waveform. Defaults to 16000. - snip_edges (bool, optional): Drop samples in the end of waveform that cann't fit a signal frame when it + snip_edges (bool, optional): Drop samples in the end of waveform that can't fit a signal frame when it is set True. Otherwise performs reflect padding to the end of waveform. Defaults to True. subtract_mean (bool, optional): Whether to subtract mean of feature files. Defaults to False. use_energy (bool, optional): Add an dimension with energy of spectrogram to the output. Defaults to False. @@ -566,7 +566,7 @@ def mfcc(waveform: Tensor, round_to_power_of_two (bool, optional): If True, round window size to power of two by zero-padding input to FFT. Defaults to True. sr (int, optional): Sample rate of input waveform. Defaults to 16000. - snip_edges (bool, optional): Drop samples in the end of waveform that cann't fit a signal frame when it + snip_edges (bool, optional): Drop samples in the end of waveform that can't fit a signal frame when it is set True. Otherwise performs reflect padding to the end of waveform. Defaults to True. subtract_mean (bool, optional): Whether to subtract mean of feature files. Defaults to False. use_energy (bool, optional): Add an dimension with energy of spectrogram to the output. Defaults to False. diff --git a/audio/paddleaudio/compliance/librosa.py b/audio/paddleaudio/compliance/librosa.py index c24d6d497..d0cee642a 100644 --- a/audio/paddleaudio/compliance/librosa.py +++ b/audio/paddleaudio/compliance/librosa.py @@ -527,7 +527,7 @@ def melspectrogram(x: np.ndarray, if fmax is None: fmax = sr // 2 if fmin < 0 or fmin >= fmax: - raise ParameterError('fmin and fmax must statisfy 0* feats) { return false; } - // appply cmvn + // apply cmvn kaldi::Timer timer; Compute(feats); VLOG(1) << "CMVN::Read cost: " << timer.Elapsed() << " sec."; diff --git a/runtime/engine/common/frontend/cmvn.h b/runtime/engine/common/frontend/cmvn.h index c515b6aeb..2d8917d95 100644 --- a/runtime/engine/common/frontend/cmvn.h +++ b/runtime/engine/common/frontend/cmvn.h @@ -29,7 +29,7 @@ class CMVN : public FrontendInterface { // the length of feats = feature_row * feature_dim, // the Matrix is squashed into Vector virtual bool Read(std::vector* feats); - // the dim_ is the feautre dim. + // the dim_ is the feature dim. virtual size_t Dim() const { return dim_; } virtual void SetFinished() { base_extractor_->SetFinished(); } virtual bool IsFinished() const { return base_extractor_->IsFinished(); } diff --git a/runtime/engine/common/frontend/db_norm.h b/runtime/engine/common/frontend/db_norm.h index 425971437..e9f8b6995 100644 --- a/runtime/engine/common/frontend/db_norm.h +++ b/runtime/engine/common/frontend/db_norm.h @@ -47,7 +47,7 @@ class DecibelNormalizer : public FrontendInterface { std::unique_ptr base_extractor); virtual void Accept(const kaldi::VectorBase& waves); virtual bool Read(kaldi::Vector* waves); - // noramlize audio, the dim is 1. + // normalize audio, the dim is 1. virtual size_t Dim() const { return dim_; } virtual void SetFinished() { base_extractor_->SetFinished(); } virtual bool IsFinished() const { return base_extractor_->IsFinished(); } diff --git a/runtime/engine/common/matrix/kaldi-matrix.cc b/runtime/engine/common/matrix/kaldi-matrix.cc index 6f65fb0a0..65e8e09a6 100644 --- a/runtime/engine/common/matrix/kaldi-matrix.cc +++ b/runtime/engine/common/matrix/kaldi-matrix.cc @@ -244,8 +244,8 @@ void MatrixBase::SymAddMat2(const Real alpha, /// function will produce NaN in the output. This is a bug in the /// ATLAS library. To overcome this, the AddMatMat function, which calls /// cblas_Xgemm(...) rather than cblas_Xsyrk(...), is used in this special - /// sitation. - /// Wei Shi: Note this bug is observerd for single precision matrix + /// situation. + /// Wei Shi: Note this bug is observed for single precision matrix /// on a 64-bit machine #ifdef HAVE_ATLAS if (transA == kTrans && num_rows_ >= 56) { @@ -683,7 +683,7 @@ empty. if (V_in == NULL) tmpV.Resize(1, this->num_cols_); // work-space if V_in empty. - /// Impementation notes: + /// Implementation notes: /// Lapack works in column-order, therefore the dimensions of *this are /// swapped as well as the U and V matrices. @@ -2378,7 +2378,7 @@ bool ReadHtk(std::istream &is, Matrix *M_ptr, HtkHeader *header_ptr) Matrix &M = *M_ptr; HtkHeader htk_hdr; - // TODO(arnab): this fails if the HTK file has CRC cheksum or is compressed. + // TODO(arnab): this fails if the HTK file has CRC checksum or is compressed. is.read((char*)&htk_hdr, sizeof(htk_hdr)); // we're being really POSIX here! if (is.fail()) { KALDI_WARN << "Could not read header from HTK feature file "; diff --git a/runtime/engine/common/matrix/kaldi-vector.cc b/runtime/engine/common/matrix/kaldi-vector.cc index 3ab9a7ffa..790ebe128 100644 --- a/runtime/engine/common/matrix/kaldi-vector.cc +++ b/runtime/engine/common/matrix/kaldi-vector.cc @@ -235,7 +235,7 @@ void VectorBase::CopyRowsFromMat(const MatrixBase &mat) { memcpy(inc_data, mat.Data(), cols * rows * sizeof(Real)); } else { for (MatrixIndexT i = 0; i < rows; i++) { - // copy the data to the propper position + // copy the data to the proper position memcpy(inc_data, mat.RowData(i), cols * sizeof(Real)); // set new copy position inc_data += cols; diff --git a/runtime/engine/common/utils/file_utils.cc b/runtime/engine/common/utils/file_utils.cc index 385f2b656..59bb64482 100644 --- a/runtime/engine/common/utils/file_utils.cc +++ b/runtime/engine/common/utils/file_utils.cc @@ -44,7 +44,7 @@ std::string ReadFile2String(const std::string& path) { } bool FileExists(const std::string& strFilename) { - // this funciton if from: + // this function if from: // https://github.com/kaldi-asr/kaldi/blob/master/src/fstext/deterministic-fst-test.cc struct stat stFileInfo; bool blnReturn; diff --git a/runtime/engine/kaldi/lat/kaldi-lattice.cc b/runtime/engine/kaldi/lat/kaldi-lattice.cc index 744cc5384..0bd291ee1 100644 --- a/runtime/engine/kaldi/lat/kaldi-lattice.cc +++ b/runtime/engine/kaldi/lat/kaldi-lattice.cc @@ -407,7 +407,7 @@ bool WriteLattice(std::ostream &os, bool binary, const Lattice &t) { if (os.fail()) KALDI_WARN << "Stream failure detected."; // Write another newline as a terminating character. The read routine will - // detect this [this is a Kaldi mechanism, not somethig in the original + // detect this [this is a Kaldi mechanism, not something in the original // OpenFst code]. os << '\n'; return os.good(); diff --git a/runtime/examples/README.md b/runtime/examples/README.md index de27bd94b..6d316d649 100644 --- a/runtime/examples/README.md +++ b/runtime/examples/README.md @@ -34,7 +34,7 @@ bash run.sh --stop_stage 4 ## Display Model with [Netron](https://github.com/lutzroeder/netron) -If you have a model, we can using this commnd to show model graph. +If you have a model, we can using this commend to show model graph. For example: ``` diff --git a/runtime/examples/audio_classification/README.md b/runtime/examples/audio_classification/README.md index 6d7a37423..7fb8d611a 100644 --- a/runtime/examples/audio_classification/README.md +++ b/runtime/examples/audio_classification/README.md @@ -74,7 +74,7 @@ includes/ #### set path push resource into android phone -1. change resource path in conf to gloabal path, such as: +1. change resource path in conf to global path, such as: [CONF] wav_normal=true @@ -92,9 +92,9 @@ push resource into android phone high_freq=14000 dither=0.0 2. adb push conf label_list scp test.wav /data/local/tmp/ -3. set reource path in android demo(android_demo/app/src/main/cpp/native-lib.cpp) to actual path, such as: +3. set resource path in android demo(android_demo/app/src/main/cpp/native-lib.cpp) to actual path, such as: std::string conf_path = "/data/local/tmp/conf"; std::string wav_path = "/data/local/tmp/test.wav"; -4. excecute android_demo in android studio +4. execute android_demo in android studio diff --git a/runtime/examples/text_lm/local/mmseg.py b/runtime/examples/text_lm/local/mmseg.py index d5bff6df3..4d72afd39 100755 --- a/runtime/examples/text_lm/local/mmseg.py +++ b/runtime/examples/text_lm/local/mmseg.py @@ -253,7 +253,6 @@ class Analysis: # print(word3.length, word3.text) if word3.length == -1: chunk = Chunk(word1, word2) - # print("Ture") else: chunk = Chunk(word1, word2, word3) chunks.append(chunk) diff --git a/runtime/patch/openfst/src/include/fst/flags.h b/runtime/patch/openfst/src/include/fst/flags.h index b5ec8ff74..54dd30cc2 100644 --- a/runtime/patch/openfst/src/include/fst/flags.h +++ b/runtime/patch/openfst/src/include/fst/flags.h @@ -181,8 +181,8 @@ template class FlagRegisterer { public: FlagRegisterer(const string &name, const FlagDescription &desc) { - auto registr = FlagRegister::GetRegister(); - registr->SetDescription(name, desc); + auto r = FlagRegister::GetRegister(); + r->SetDescription(name, desc); } private: diff --git a/tests/test_tipc/conformer/scripts/aishell_tiny.py b/tests/test_tipc/conformer/scripts/aishell_tiny.py index c87463b50..27b713a55 100644 --- a/tests/test_tipc/conformer/scripts/aishell_tiny.py +++ b/tests/test_tipc/conformer/scripts/aishell_tiny.py @@ -62,7 +62,7 @@ def create_manifest(data_dir, manifest_path_prefix): if line == '': continue audio_id, text = line.split(' ', 1) - # remove withespace, charactor text + # remove withespace, character text text = ''.join(text.split()) transcript_dict[audio_id] = text diff --git a/tests/unit/cli/aishell_test_prepare.py b/tests/unit/cli/aishell_test_prepare.py index c364e4fd9..ef582426c 100644 --- a/tests/unit/cli/aishell_test_prepare.py +++ b/tests/unit/cli/aishell_test_prepare.py @@ -63,7 +63,7 @@ def create_manifest(data_dir, manifest_path_prefix): if line == '': continue audio_id, text = line.split(' ', 1) - # remove withespace, charactor text + # remove withespace, character text text = ''.join(text.split()) transcript_dict[audio_id] = text diff --git a/tests/unit/tts/test_snapshot.py b/tests/unit/tts/test_snapshot.py index fb18c7d78..750e6b68d 100644 --- a/tests/unit/tts/test_snapshot.py +++ b/tests/unit/tts/test_snapshot.py @@ -30,7 +30,7 @@ def _test_snapshot(): # use a simplest iterable object as dataloader dataloader = count() - # hack the training proecss: training does nothing except increse iteration + # hack the training proecss: training does nothing except increase iteration updater = StandardUpdater(model, optimizer, dataloader=dataloader) updater.update_core = lambda x: None diff --git a/tools/extras/install_liblbfgs.sh b/tools/extras/install_liblbfgs.sh index 1fa727d1f..0148bd841 100755 --- a/tools/extras/install_liblbfgs.sh +++ b/tools/extras/install_liblbfgs.sh @@ -17,7 +17,7 @@ cd liblbfgs-$VER ./configure --prefix=`pwd` make # due to the liblbfgs project directory structure, we have to use -i -# but the erros are completely harmless +# but the errors are completely harmless make -i install cd .. diff --git a/utils/format_triplet_data.py b/utils/format_triplet_data.py index e9a0cf54c..029ea2d9b 100755 --- a/utils/format_triplet_data.py +++ b/utils/format_triplet_data.py @@ -44,7 +44,7 @@ add_arg('manifest_paths', str, # bpe add_arg('spm_model_prefix', str, None, "spm model prefix, spm_model_%(bpe_mode)_%(count_threshold), only need when `unit_type` is spm") -add_arg('output_path', str, None, "filepath of formated manifest.", required=True) +add_arg('output_path', str, None, "filepath of formatted manifest.", required=True) # yapf: disable args = parser.parse_args() diff --git a/utils/tokenizer.perl b/utils/tokenizer.perl index 836fe19c6..babf81886 100644 --- a/utils/tokenizer.perl +++ b/utils/tokenizer.perl @@ -79,7 +79,7 @@ if ($HELP) print " -b ... disable Perl buffering.\n"; print " -time ... enable processing time calculation.\n"; print " -penn ... use Penn treebank-like tokenization.\n"; - print " -protected FILE ... specify file with patters to be protected in tokenisation.\n"; + print " -protected FILE ... specify file with patterns to be protected in tokenisation.\n"; print " -no-escape ... don't perform HTML escaping on apostrophy, quotes, etc.\n"; exit; }