abdullahedcults commited on
Commit
827a599
1 Parent(s): 1ed62d4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +69 -0
README.md CHANGED
@@ -8,5 +8,74 @@ sdk_version: 1.21.0
8
  app_file: app.py
9
  pinned: false
10
  ---
 
 
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
8
  app_file: app.py
9
  pinned: false
10
  ---
11
+ Translate and Transcribe Audio
12
+ The "Translate and Transcribe Audio" program is a Streamlit web application that allows users to transcribe audio files, translate the transcribed English text to Hindi, and listen to the original and translated audio.
13
 
14
+ Requirements
15
+ Before running the application, make sure you have the following dependencies installed. You can install them using pip and the provided requirements.txt file:
16
+
17
+
18
+ transformers
19
+ git+https://github.com/openai/whisper.git
20
+ sentencepiece
21
+ pydub
22
+ whisper
23
+ streamlit
24
+ sounddevice
25
+ soundfile
26
+ audio-recorder-streamlit
27
+
28
+
29
+
30
+ Running the Application
31
+
32
+ To run the "Translate and Transcribe Audio" application, follow these steps:
33
+
34
+ Save the app.py and requirements.txt files in a directory on your machine.
35
+
36
+ Install the required dependencies using the requirements.txt file, as mentioned in the Requirements section.
37
+
38
+ Open a terminal or command prompt and navigate to the directory containing app.py and requirements.txt.
39
+
40
+ Run the Streamlit application using the following command:
41
+
42
+ streamlit run app.py
43
+
44
+
45
+ A local development server will start, and the application will be accessible in your web browser at http://localhost:8501.
46
+ Usage
47
+ The "Translate and Transcribe Audio" application provides two ways to transcribe and translate audio:
48
+
49
+ Audio Recording: Click on the "Mic" button and start speaking. The audio will be recorded and transcribed. The original English text and its translation in Hindi will be displayed.
50
+
51
+ Upload Audio File: You can also upload a WAV format audio file. The application will transcribe the audio and provide the corresponding translation.
52
+
53
+ How It Works
54
+ The application uses the "audio-recorder-streamlit" library to record audio through the computer's microphone.
55
+
56
+ The recorded audio is transcribed using the "whisper" library, which is an automatic speech recognition (ASR) system.
57
+
58
+ The transcribed English text is then translated to Hindi using the "transformers" library, which employs the Helsinki-NLP's "opus-mt-en-hi" model for machine translation.
59
+
60
+ The translated text and the original audio are displayed to the user.
61
+
62
+ Note
63
+ The "whisper" library is used for speech recognition, and its performance may vary based on the audio quality and accents in the recorded audio.
64
+
65
+ The "transformers" library uses machine learning models for translation, and the translation accuracy may not be perfect, but it should provide a reasonable translation in most cases.
66
+
67
+ The program saves the audio to a file named "audio.mp3" for the recording option and "uploaded_audio.wav" for the uploaded file option. These files are temporary and are deleted after processing.
68
+
69
+
70
+ Limitations
71
+ The performance of automatic speech recognition (ASR) and machine translation heavily depends on the quality of the audio and the complexity of the language being translated. The accuracy of the results may not be perfect, but the libraries and models used in this application aim to provide reasonable outputs.
72
+
73
+ For best results, try to use clear and high-quality audio files when using the upload option.
74
+
75
+ Conclusion
76
+ The "Translate and Transcribe Audio" application demonstrates the power of combining ASR and machine translation to convert spoken English into written Hindi. It can be used for various purposes, including language learning, accessibility, and communication across language barriers.
77
+
78
+ Please note that this application is provided as a demonstration and may require further optimization or customization based on specific use cases.
79
+
80
+ For any issues or suggestions, please feel free to reach out to the developer.
81
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference