Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -139,6 +139,18 @@ def text2int(textnum, numwords={}):
|
|
| 139 |
if not textnum:
|
| 140 |
return None
|
| 141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
######################################################
|
| 144 |
demo=gr.Interface(
|
|
|
|
| 139 |
if not textnum:
|
| 140 |
return None
|
| 141 |
|
| 142 |
+
# Convert sentence to transcript using Soundex
|
| 143 |
+
def sentence_to_transcript(sentence, word_to_code_map):
|
| 144 |
+
words = sentence.split()
|
| 145 |
+
transcript_codes = []
|
| 146 |
+
|
| 147 |
+
for word in words:
|
| 148 |
+
if word not in word_to_code_map:
|
| 149 |
+
word_to_code_map[word] = soundex(word)
|
| 150 |
+
transcript_codes.append(word_to_code_map[word])
|
| 151 |
+
|
| 152 |
+
transcript = ' '.join(transcript_codes)
|
| 153 |
+
return transcript
|
| 154 |
|
| 155 |
######################################################
|
| 156 |
demo=gr.Interface(
|