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ừ PyPi:
$ pip install SpeechRecognition
# Import thư viện SpeechRecognition import speech_recognition as sr# Tạo một đối tượng Recognizer recognizer = sr.Recognizer()# Đặt ngưỡng năng lượng recognizer.energy_threshold = 300
Recognizer có sẵn hàm tương tác với các API nhận dạng giọng nóirecognize_bing()recognize_google()recognize_google_cloud()recognize_wit()Đầu vào: audio_file
Đầu ra: văn bản nhận dạng từ audio_file
Tập trung vào recognize_google()
Nhận dạng 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