Browse Source

Add documentation for newly added function

tags/v0.3.11-rc1
haixuantao 10 months ago
parent
commit
473dd34dbb
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      node-hub/dora-distil-whisper/dora_distil_whisper/main.py

+ 11
- 1
node-hub/dora-distil-whisper/dora_distil_whisper/main.py View File

@@ -15,7 +15,17 @@ TARGET_LANGUAGE = os.getenv("TARGET_LANGUAGE", "english")
TRANSLATE = bool(os.getenv("TRANSLATE", "False") in ["True", "true"])


def remove_text_noise(text, text_noise):
def remove_text_noise(text: str, text_noise="") -> str:
"""Remove noise from text.

Args:
text (str): Original text
text_noise (str): text to remove from the original text

Returns:
str: Cleaned text

"""
# Handle the case where text_noise is empty
if not text_noise.strip():
return (


Loading…
Cancel
Save