This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"intents": | |
[ | |
{ | |
"tag":"greeting", | |
"input":["hello","hi there","nice to meet you","hi there boi","any nerds here ?","hi","hey there","hey","hi there","hi, nice to meet you","hello there","anyone there ?","hello nerds","knock knock"], | |
"responses":[ | |
"Hi. Welcome to the the brain of eeman", | |
"Ayoo, do you need help ?", | |
"welcome, how may I help you ?", | |
"ello there", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gtts import gTTS | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def speak(r): | |
language='en' | |
text1=str(r) | |
myobj = gTTS(text=text1, lang=language, slow=False) | |
myobj.save("DEW/voice.mp3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#importing the libraries | |
import tensorflow as tf | |
import numpy as np | |
import pandas as pd | |
import json | |
import nltk | |
import speak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import speech_recognition as sr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create the recognizer | |
r = sr.Recognizer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define the microphone | |
mic = sr.Microphone(device_index=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# record your speech | |
with mic as source: | |
audio = r.listen(source) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# speech recognition | |
result = r.recognize_google(audio) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# export the result | |
with open('my_result.txt',mode ='w') as file: | |
file.write("Recognized text:") | |
file.write("\n") | |
file.write(result) | |
result=str(result) | |
print("Exporting process completed!") |
OlderNewer