cdactvm commited on
Commit
34d57c8
·
verified ·
1 Parent(s): 2f45a75

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -13
app.py CHANGED
@@ -31,6 +31,22 @@ from waveletDenoise import wavelet_denoise
31
  from scipy.signal import butter, lfilter, wiener
32
 
33
  asr_model = pipeline("automatic-speech-recognition", model="cdactvm/w2v-bert-tamil_new")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  lex=createlex("num_words_ta.txt")
35
  # Function to apply a high-pass filter
36
  def high_pass_filter(audio, sr, cutoff=300):
@@ -52,20 +68,7 @@ def wavelet_denoise(audio, wavelet='db1', level=1):
52
  def apply_wiener_filter(audio):
53
  return wiener(audio)
54
 
55
- def createlex(filename):
56
-
57
 
58
- # Initialize an empty dictionary
59
- data_dict = {}
60
-
61
- # Open the file and read it line by line
62
- with open(filename, "r", encoding="utf-8") as f:
63
- for line in f:
64
- # Strip newline characters and split by tab
65
- key, value = line.strip().split("\t")
66
- # Add to dictionary
67
- data_dict[key] = value
68
- return data_dict
69
 
70
  def addnum(inlist):
71
  sum=0
 
31
  from scipy.signal import butter, lfilter, wiener
32
 
33
  asr_model = pipeline("automatic-speech-recognition", model="cdactvm/w2v-bert-tamil_new")
34
+
35
+ def createlex(filename):
36
+
37
+
38
+ # Initialize an empty dictionary
39
+ data_dict = {}
40
+
41
+ # Open the file and read it line by line
42
+ with open(filename, "r", encoding="utf-8") as f:
43
+ for line in f:
44
+ # Strip newline characters and split by tab
45
+ key, value = line.strip().split("\t")
46
+ # Add to dictionary
47
+ data_dict[key] = value
48
+ return data_dict
49
+
50
  lex=createlex("num_words_ta.txt")
51
  # Function to apply a high-pass filter
52
  def high_pass_filter(audio, sr, cutoff=300):
 
68
  def apply_wiener_filter(audio):
69
  return wiener(audio)
70
 
 
 
71
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
  def addnum(inlist):
74
  sum=0