Xử lý Ngôn ngữ Nói bằng Python
Daniel Bourke
Machine Learning Engineer/YouTube Creator
Một số thư viện Python hiện có
Cài đặt từ PyPi:
$ pip install SpeechRecognition
# Import thư viện SpeechRecognition import speech_recognition as sr# Tạo một thể hiện Recognizer recognizer = sr.Recognizer()# Thiết lập ngưỡng năng lượng recognizer.energy_threshold = 300
Recognizer có sẵn các hàm làm việc với API nhận dạng giọng nóirecognize_bing()recognize_google()recognize_google_cloud()recognize_wit()Input: audio_file
Output: văn bản nhận dạng từ audio_file
Tập trung vào recognize_google()
Nhận dạng giọng nói từ tệp âm thanh với SpeechRecognition:
# Import thư viện SpeechRecognition import speech_recognition as sr# Khởi tạo lớp Recognizer recognizer = sr.Recognizer()# Phiên âm bằng Google web API recognizer.recognize_google(audio_data=audio_file, language="en-US")
Học nhận dạng giọng nói trên DataCamp thật tuyệt!
Xử lý Ngôn ngữ Nói bằng Python