antony66 commited on
Commit
c47e9c0
1 Parent(s): 564e7f5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -1
README.md CHANGED
@@ -25,6 +25,14 @@ The finetuning process took over 60 hours on dual Tesla A100 80Gb.
25
 
26
  ## Usage
27
 
 
 
 
 
 
 
 
 
28
  ```python
29
  import torch
30
  from transformers import WhisperForConditionalGeneration, WhisperProcessor, pipeline
@@ -62,7 +70,7 @@ asr_pipeline = pipeline(
62
  # read your wav file into variable wav. For example:
63
  from io import BufferIO
64
  wav = BytesIO()
65
- with open('call.wav', 'rb') as f:
66
  wav.write(f.read())
67
  wav.seek(0)
68
 
 
25
 
26
  ## Usage
27
 
28
+ In order to process phone calls it is highly recommended that you preprocess your records and adjust volume before performing ASR. For example, like this:
29
+
30
+ ```bash
31
+ sox record.wav -r 16k record-normalized.wav norm -0.5 compand 0.3,1 -90,-90,-70,-70,-60,-20,0,0 -5 0 0.2
32
+ ```
33
+
34
+ Then your ASR code should look somewhat like this:
35
+
36
  ```python
37
  import torch
38
  from transformers import WhisperForConditionalGeneration, WhisperProcessor, pipeline
 
70
  # read your wav file into variable wav. For example:
71
  from io import BufferIO
72
  wav = BytesIO()
73
+ with open('record-normalized.wav', 'rb') as f:
74
  wav.write(f.read())
75
  wav.seek(0)
76