Spaces:
Runtime error
Runtime error
jaekookang
commited on
Commit
·
91ee8ee
1
Parent(s):
9cec2f1
update logging
Browse files- README.md +8 -0
- gradio_asr_en_libri100_word_vs_bpe.py +4 -1
- test.py +0 -12
README.md
CHANGED
@@ -9,4 +9,12 @@ pinned: false
|
|
9 |
license: mit
|
10 |
---
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
|
|
9 |
license: mit
|
10 |
---
|
11 |
|
12 |
+
|
13 |
+
- 2022-02-23
|
14 |
+
- audio reading was not successful
|
15 |
+
- live recording data seemed not be correctly saved or transferred to the server
|
16 |
+
- different audio modules were tried, but failed
|
17 |
+
- librosa.load() surprizingly worked again
|
18 |
+
|
19 |
+
|
20 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
gradio_asr_en_libri100_word_vs_bpe.py
CHANGED
@@ -56,7 +56,10 @@ def predict(wav_file):
|
|
56 |
bpe_decoded = B[0]
|
57 |
# comparison = ''.join(list(d.compare([word_decoded+'\n'], [bpe_decoded+'\n'])))
|
58 |
|
59 |
-
logger.info('
|
|
|
|
|
|
|
60 |
# return word_decoded, bpe_decoded, comparison
|
61 |
return word_decoded, bpe_decoded
|
62 |
|
|
|
56 |
bpe_decoded = B[0]
|
57 |
# comparison = ''.join(list(d.compare([word_decoded+'\n'], [bpe_decoded+'\n'])))
|
58 |
|
59 |
+
logger.info(f'--- word-based model decoded: {word_decoded}')
|
60 |
+
logger.info(f'--- BPE-based model decoded: {bpe_decoded}')
|
61 |
+
|
62 |
+
logger.info('finished')
|
63 |
# return word_decoded, bpe_decoded, comparison
|
64 |
return word_decoded, bpe_decoded
|
65 |
|
test.py
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
def best_overlap(a, b):
|
2 |
-
return max([(score(a[offset:], b), offset) for offset in range(len(a))], key=lambda x: x[0])[1]
|
3 |
-
|
4 |
-
def score(a, b):
|
5 |
-
return sum([a[i] == b[i] for i in range(len(a))])
|
6 |
-
|
7 |
-
a = 'abcde'
|
8 |
-
b = 'abbde'
|
9 |
-
|
10 |
-
print(best_overlap(a, b))
|
11 |
-
print(a + '-' * best_overlap(a, b))
|
12 |
-
print('-' * best_overlap(a, b) + b)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|