{"id":454904,"date":"2025-04-06T03:00:17","date_gmt":"2025-04-06T03:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=454904"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=454904","title":{"rendered":"<span>\u041a\u0430\u043a \u044f \u0434\u0435\u043b\u0430\u043b \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u043d\u0430 NLP \u0438 \u043d\u0435 \u0441\u043e\u0448\u0435\u043b \u0441 \u0443\u043c\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/806\/52c\/cfa\/80652ccfa0c156dc4754fd8663c97d20.png\" width=\"1536\" height=\"1024\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/806\/52c\/cfa\/80652ccfa0c156dc4754fd8663c97d20.png\"\/><\/figure>\n<p>\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0435 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u044b \u0434\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u0440\u0443\u0448\u043a\u043e\u0439 \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043c\u0435\u044e\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f, \u0438\u0441\u043a\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0434\u0430\u0436\u0435 \u0448\u0443\u0442\u0438\u0442\u044c (\u0438\u043d\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u044e\u0434\u0435\u0439). \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 Python, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 NLP-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0411\u0435\u0437 Siri, \u0431\u0435\u0437 Alexa, \u0432\u0441\u0451 \u0441\u0432\u043e\u0451, \u0440\u043e\u0434\u043d\u043e\u0435.<\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u0432\u0441\u0451 \u044d\u0442\u043e?<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0442\u0435\u0431\u0435 \u043f\u043e \u0434\u0435\u043b\u0443 \u2014 \u044d\u0442\u043e \u043c\u0430\u0433\u0438\u044f. \u041d\u043e \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0430 \u043c\u0430\u0433\u0438\u044f \u0441\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c, \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u043a\u0443\u0447\u0430 \u0445\u0438\u0442\u0440\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439: \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438 (ASR), \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 (NLP), \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u0438\u043d\u0442\u0435\u0437 \u0440\u0435\u0447\u0438 (TTS)\u2026 \u0438 \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u044c \u043e\u0434\u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043f\u043d\u0451\u0442\u0441\u044f \u2014 \u043f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u043e\u0441. \u0410 \u0435\u0449\u0451 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u0441\u043b\u0438\u0432\u0430\u043b \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0442\u0440\u0435\u0442\u044c\u0438\u0445 \u043b\u0438\u0446, \u0434\u0430?<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0447\u044c, \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442 \u0438 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043e \u0447\u0451\u043c \u0432\u044b \u0441 \u043d\u0438\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438. \u0412\u0441\u0451 \u043d\u0430 Python, \u043f\u043e-\u0432\u0437\u0440\u043e\u0441\u043b\u043e\u043c\u0443.<\/p>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430<\/h3>\n<p>\u0412\u043e\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p><strong>ASR (Automatic Speech Recognition)<\/strong> \u2014 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438 \u0438\u0437 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>NLP Engine<\/strong> \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>Dialogue Manager<\/strong> \u2014 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u043c, \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>TTS (Text-to-Speech)<\/strong> \u2014 \u043e\u0437\u0432\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>API Layer<\/strong> \u2014 \u0435\u0441\u043b\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0443 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>Whisper \u043e\u0442 OpenAI \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438.<\/p>\n<\/li>\n<li>\n<p>Rasa \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0432\u0438\u0436\u043a\u0430 \u0434\u043b\u044f \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432 \u0438 NLP.<\/p>\n<\/li>\n<li>\n<p>pyttsx3 \u0434\u043b\u044f \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0440\u0435\u0447\u0438.<\/p>\n<\/li>\n<li>\n<p>SpeechRecognition \u0434\u043b\u044f \u0437\u0430\u0445\u0432\u0430\u0442\u0430 \u0433\u043e\u043b\u043e\u0441\u0430.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0427\u0430\u0441\u0442\u044c 1: \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438 \u0441 Whisper<\/h3>\n<p>Whisper \u2014 \u044d\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442 OpenAI, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0430\u0443\u0434\u0438\u043e. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0447\u0435\u0440\u0435\u0437 whisper \u0438\u043b\u0438 faster-whisper.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 Python:<\/h4>\n<pre><code class=\"python\">import whisper import sounddevice as sd import numpy as np import scipy.io.wavfile  model = whisper.load_model(\"base\")  def record_audio(duration=5, fs=16000):     print(\"\u0413\u043e\u0432\u043e\u0440\u0438...\")     audio = sd.rec(int(duration * fs), samplerate=fs, channels=1, dtype='int16')     sd.wait()     return np.squeeze(audio)  def save_wav(filename, audio, fs=16000):     scipy.io.wavfile.write(filename, fs, audio)  audio = record_audio() save_wav(\"temp.wav\", audio)  result = model.transcribe(\"temp.wav\") print(\"\u0422\u044b \u0441\u043a\u0430\u0437\u0430\u043b:\", result[\"text\"])<\/code><\/pre>\n<h3>\u0427\u0430\u0441\u0442\u044c 2: NLP \u0441 Rasa<\/h3>\n<p>Rasa \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0439, \u0441\u043b\u043e\u0442\u043e\u0432, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<pre><code class=\"yaml\"># nlu.yml version: \"3.1\"  nlu: - intent: greet   examples: |     - \u041f\u0440\u0438\u0432\u0435\u0442     - \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439     - \u0414\u043e\u0431\u0440\u043e\u0435 \u0443\u0442\u0440\u043e  - intent: ask_weather   examples: |     - \u041a\u0430\u043a\u0430\u044f \u043f\u043e\u0433\u043e\u0434\u0430?     - \u0427\u0442\u043e \u0442\u0430\u043c \u0441 \u043f\u043e\u0433\u043e\u0434\u043e\u0439?     - \u0411\u0443\u0434\u0435\u0442 \u0434\u043e\u0436\u0434\u044c?  # domain.yml intents:   - greet   - ask_weather  responses:   utter_greet:     - text: \"\u041f\u0440\u0438\u0432\u0435\u0442! \u0427\u0435\u043c \u043c\u043e\u0433\u0443 \u043f\u043e\u043c\u043e\u0447\u044c?\"   utter_weather:     - text: \"\u041f\u043e\u0433\u043e\u0434\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f, \u0441\u043e\u043b\u043d\u044b\u0448\u043a\u043e \u0441\u0432\u0435\u0442\u0438\u0442!\"<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0438\u0448\u0435\u043c stories, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <code>rasa train<\/code>, \u0438 \u0432\u0441\u0451 \u2014 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h3>\u0427\u0430\u0441\u0442\u044c 3: \u0421\u0438\u043d\u0442\u0435\u0437 \u0440\u0435\u0447\u0438<\/h3>\n<p>\u0414\u043b\u044f TTS \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>pyttsx3<\/code>, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0444\u0444\u043b\u0430\u0439\u043d \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0448\u0443\u0441\u0442\u0440\u044b\u0439.<\/p>\n<pre><code class=\"python\">import pyttsx3  engine = pyttsx3.init() engine.say(\"\u041f\u0440\u0438\u0432\u0435\u0442! \u042f \u0442\u0432\u043e\u0439 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442.\") engine.runAndWait()<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0441, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041d\u0430 \u0432\u0438\u043d\u0434\u0435 \u0438 \u043c\u0430\u043a\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0433\u043e\u043b\u043e\u0441\u0430, \u043d\u043e \u043e\u0431\u0449\u0435\u0435 API \u2014 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435.<\/p>\n<h3>\u0427\u0430\u0441\u0442\u044c 4: \u0421\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u0446\u0438\u043a\u043b:<\/p>\n<ol>\n<li>\n<p>\u0413\u043e\u043b\u043e\u0441 \u2192 \u0442\u0435\u043a\u0441\u0442 (Whisper)<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043a\u0441\u0442 \u2192 \u0438\u043d\u0442\u0435\u043d\u0442 (Rasa)<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0432\u0435\u0442 \u2192 \u0442\u0435\u043a\u0441\u0442 (Rasa)<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043a\u0441\u0442 \u2192 \u0440\u0435\u0447\u044c (pyttsx3)<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\"># main.py from rasa.core.agent import Agent from whisper import load_model import pyttsx3  agent = Agent.load('models')  # \u043f\u0443\u0442\u044c \u043a \u043c\u043e\u0434\u0435\u043b\u0438 rasa asr_model = load_model(\"base\") tts = pyttsx3.init()  while True:     audio = record_audio()     save_wav(\"temp.wav\", audio)     result = asr_model.transcribe(\"temp.wav\")     user_text = result[\"text\"]      response = agent.handle_text(user_text)     if response:         reply = response[0]['text']         print(f\"\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442: {reply}\")         tts.say(reply)         tts.runAndWait()<\/code><\/pre>\n<h3>\u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c?<\/h3>\n<ul>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>pyttsx3<\/code> \u043d\u0430 <code>Coqui TTS<\/code> \u0438\u043b\u0438 <code>VITS<\/code> \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0434\u0438\u0430\u043b\u043e\u0433\u0430 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 API \u2014 \u043f\u043e\u0433\u043e\u0434\u0443, \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0438, \u0437\u0430\u043c\u0435\u0442\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043d\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043a\u0430\u043a \u0443 Google \u0438\u043b\u0438 Amazon. \u041c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0439\u0442\u0438 \u0434\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430. \u0418 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c, \u043a\u0430\u043a \u0442\u0435\u0431\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440. \u041f\u0443\u0441\u0442\u044c \u0431\u0443\u0440\u0447\u0438\u0442 \u043f\u043e \u0443\u0442\u0440\u0430\u043c \u0438\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u00ab\u041c\u0430\u0441\u0442\u0435\u0440, \u0432\u044b \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u043d\u044b\u00bb.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430. \u041f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u0441 \u043f\u043e \u0438\u043c\u0435\u043d\u0438.  <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/897862\/\"> https:\/\/habr.com\/ru\/articles\/897862\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0413\u043e\u043b\u043e\u0441\u043e\u0432\u044b\u0435 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u044b \u0434\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0438 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u0440\u0443\u0448\u043a\u043e\u0439 \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043c\u0435\u044e\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f, \u0438\u0441\u043a\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0434\u0430\u0436\u0435 \u0448\u0443\u0442\u0438\u0442\u044c (\u0438\u043d\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043b\u044e\u0434\u0435\u0439). \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c, \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u0441 \u043d\u0443\u043b\u044f \u043d\u0430 Python, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 NLP-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0411\u0435\u0437 Siri, \u0431\u0435\u0437 Alexa, \u0432\u0441\u0451 \u0441\u0432\u043e\u0451, \u0440\u043e\u0434\u043d\u043e\u0435.<\/p>\n<h3>\u0417\u0430\u0447\u0435\u043c \u0432\u0441\u0451 \u044d\u0442\u043e?<\/h3>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0442\u0435\u0431\u0435 \u043f\u043e \u0434\u0435\u043b\u0443 \u2014 \u044d\u0442\u043e \u043c\u0430\u0433\u0438\u044f. \u041d\u043e \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u0430 \u043c\u0430\u0433\u0438\u044f \u0441\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c, \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u043a\u0443\u0447\u0430 \u0445\u0438\u0442\u0440\u044b\u0445 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439: \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438 (ASR), \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 (NLP), \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438, \u0441\u0438\u043d\u0442\u0435\u0437 \u0440\u0435\u0447\u0438 (TTS)\u2026 \u0438 \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u044c \u043e\u0434\u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043f\u043d\u0451\u0442\u0441\u044f \u2014 \u043f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u043e\u0441. \u0410 \u0435\u0449\u0451 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043d\u0435 \u0441\u043b\u0438\u0432\u0430\u043b \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0442\u0440\u0435\u0442\u044c\u0438\u0445 \u043b\u0438\u0446, \u0434\u0430?<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0447\u044c, \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442 \u0438 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043e \u0447\u0451\u043c \u0432\u044b \u0441 \u043d\u0438\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438. \u0412\u0441\u0451 \u043d\u0430 Python, \u043f\u043e-\u0432\u0437\u0440\u043e\u0441\u043b\u043e\u043c\u0443.<\/p>\n<h3>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430<\/h3>\n<p>\u0412\u043e\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<ul>\n<li>\n<p><strong>ASR (Automatic Speech Recognition)<\/strong> \u2014 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438 \u0438\u0437 \u043c\u0438\u043a\u0440\u043e\u0444\u043e\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>NLP Engine<\/strong> \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0442\u0435\u043a\u0441\u0442\u0430, \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>Dialogue Manager<\/strong> \u2014 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u043c, \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>TTS (Text-to-Speech)<\/strong> \u2014 \u043e\u0437\u0432\u0443\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>API Layer<\/strong> \u2014 \u0435\u0441\u043b\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0443 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0438\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>Whisper \u043e\u0442 OpenAI \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0447\u0438.<\/p>\n<\/li>\n<li>\n<p>Rasa \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0434\u0432\u0438\u0436\u043a\u0430 \u0434\u043b\u044f \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432 \u0438 NLP.<\/p>\n<\/li>\n<li>\n<p>pyttsx3 \u0434\u043b\u044f \u0441\u0438\u043d\u0442\u0435\u0437\u0430 \u0440\u0435\u0447\u0438.<\/p>\n<\/li>\n<li>\n<p>SpeechRecognition \u0434\u043b\u044f \u0437\u0430\u0445\u0432\u0430\u0442\u0430 \u0433\u043e\u043b\u043e\u0441\u0430.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0427\u0430\u0441\u0442\u044c 1: \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0447\u0438 \u0441 Whisper<\/h3>\n<p>Whisper \u2014 \u044d\u0442\u043e \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0442 OpenAI, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0430\u0443\u0434\u0438\u043e. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0447\u0435\u0440\u0435\u0437 whisper \u0438\u043b\u0438 faster-whisper.<\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 Python:<\/h4>\n<pre><code class=\"python\">import whisper import sounddevice as sd import numpy as np import scipy.io.wavfile  model = whisper.load_model(\"base\")  def record_audio(duration=5, fs=16000):     print(\"\u0413\u043e\u0432\u043e\u0440\u0438...\")     audio = sd.rec(int(duration * fs), samplerate=fs, channels=1, dtype='int16')     sd.wait()     return np.squeeze(audio)  def save_wav(filename, audio, fs=16000):     scipy.io.wavfile.write(filename, fs, audio)  audio = record_audio() save_wav(\"temp.wav\", audio)  result = model.transcribe(\"temp.wav\") print(\"\u0422\u044b \u0441\u043a\u0430\u0437\u0430\u043b:\", result[\"text\"])<\/code><\/pre>\n<h3>\u0427\u0430\u0441\u0442\u044c 2: NLP \u0441 Rasa<\/h3>\n<p>Rasa \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438\u0439, \u0441\u043b\u043e\u0442\u043e\u0432, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<pre><code class=\"yaml\"># nlu.yml version: \"3.1\"  nlu: - intent: greet   examples: |     - \u041f\u0440\u0438\u0432\u0435\u0442     - \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439     - \u0414\u043e\u0431\u0440\u043e\u0435 \u0443\u0442\u0440\u043e  - intent: ask_weather   examples: |     - \u041a\u0430\u043a\u0430\u044f \u043f\u043e\u0433\u043e\u0434\u0430?     - \u0427\u0442\u043e \u0442\u0430\u043c \u0441 \u043f\u043e\u0433\u043e\u0434\u043e\u0439?     - \u0411\u0443\u0434\u0435\u0442 \u0434\u043e\u0436\u0434\u044c?  # domain.yml intents:   - greet   - ask_weather  responses:   utter_greet:     - text: \"\u041f\u0440\u0438\u0432\u0435\u0442! \u0427\u0435\u043c \u043c\u043e\u0433\u0443 \u043f\u043e\u043c\u043e\u0447\u044c?\"   utter_weather:     - text: \"\u041f\u043e\u0433\u043e\u0434\u0430 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f, \u0441\u043e\u043b\u043d\u044b\u0448\u043a\u043e \u0441\u0432\u0435\u0442\u0438\u0442!\"<\/code><\/pre>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u043f\u0438\u0448\u0435\u043c stories, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <code>rasa train<\/code>, \u0438 \u0432\u0441\u0451 \u2014 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h3>\u0427\u0430\u0441\u0442\u044c 3: \u0421\u0438\u043d\u0442\u0435\u0437 \u0440\u0435\u0447\u0438<\/h3>\n<p>\u0414\u043b\u044f TTS \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>pyttsx3<\/code>, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0444\u0444\u043b\u0430\u0439\u043d \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0448\u0443\u0441\u0442\u0440\u044b\u0439.<\/p>\n<pre><code class=\"python\">import pyttsx3  engine = pyttsx3.init() engine.say(\"\u041f\u0440\u0438\u0432\u0435\u0442! \u042f \u0442\u0432\u043e\u0439 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0439 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442.\") engine.runAndWait()<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0441, \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0442\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041d\u0430 \u0432\u0438\u043d\u0434\u0435 \u0438 \u043c\u0430\u043a\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0433\u043e\u043b\u043e\u0441\u0430, \u043d\u043e \u043e\u0431\u0449\u0435\u0435 API \u2014 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435.<\/p>\n<h3>\u0427\u0430\u0441\u0442\u044c 4: \u0421\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0439 \u0446\u0438\u043a\u043b:<\/p>\n<ol>\n<li>\n<p>\u0413\u043e\u043b\u043e\u0441 \u2192 \u0442\u0435\u043a\u0441\u0442 (Whisper)<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043a\u0441\u0442 \u2192 \u0438\u043d\u0442\u0435\u043d\u0442 (Rasa)<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0432\u0435\u0442 \u2192 \u0442\u0435\u043a\u0441\u0442 (Rasa)<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u043a\u0441\u0442 \u2192 \u0440\u0435\u0447\u044c (pyttsx3)<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"python\"># main.py from rasa.core.agent import Agent from whisper import load_model import pyttsx3  agent = Agent.load('models')  # \u043f\u0443\u0442\u044c \u043a \u043c\u043e\u0434\u0435\u043b\u0438 rasa asr_model = load_model(\"base\") tts = pyttsx3.init()  while True:     audio = record_audio()     save_wav(\"temp.wav\", audio)     result = asr_model.transcribe(\"temp.wav\")     user_text = result[\"text\"]      response = agent.handle_text(user_text)     if response:         reply = response[0]['text']         print(f\"\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442: {reply}\")         tts.say(reply)         tts.runAndWait()<\/code><\/pre>\n<h3>\u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c?<\/h3>\n<ul>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>pyttsx3<\/code> \u043d\u0430 <code>Coqui TTS<\/code> \u0438\u043b\u0438 <code>VITS<\/code> \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0434\u0438\u0430\u043b\u043e\u0433\u0430 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0435 API \u2014 \u043f\u043e\u0433\u043e\u0434\u0443, \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0438, \u0437\u0430\u043c\u0435\u0442\u043a\u0438.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0421\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0433\u043e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043d\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043a\u0430\u043a \u0443 Google \u0438\u043b\u0438 Amazon. \u041c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0448\u0430\u0433\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0439\u0442\u0438 \u0434\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430. \u0418 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c, \u043a\u0430\u043a \u0442\u0435\u0431\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>\u0410 \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440. \u041f\u0443\u0441\u0442\u044c \u0431\u0443\u0440\u0447\u0438\u0442 \u043f\u043e \u0443\u0442\u0440\u0430\u043c \u0438\u043b\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u00ab\u041c\u0430\u0441\u0442\u0435\u0440, \u0432\u044b \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u043d\u044b\u00bb.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u2014 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442\u0430. \u041f\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0430\u0441 \u043f\u043e \u0438\u043c\u0435\u043d\u0438.  <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/897862\/\"> https:\/\/habr.com\/ru\/articles\/897862\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-454904","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/454904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=454904"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/454904\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=454904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=454904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=454904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}