Intelligent Voice Assistant in Python
Вставка
- Опубліковано 5 вер 2024
- In this video we build an intelligent voice assistant in Python.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
💻 The Algorithm Bible Book: www.neuralnine...
🐍 The Python Bible Book: www.neuralnine...
👕 Programming Merch: www.neuralnine...
💻 Exclusive Content 💻
👥 Patreon: / neuralnine
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine...
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/Neu...
🎵 Outro Music From: www.bensound.com/
Being a visually impaired person and being able to follow through with this and implement successfully makes me feel very elated! I know it doesn’t mean much. But you just gained a devoted subscriber!
How did u type in the code
can you please share the code?
@@jackofspades3845 can you please share the code
Hey I use glasses but thats nothing this guy knows how to read script and I type fpr crap so its nice to find this kind of knowledgeable help and also to learn how to use ChatGpt as a script writer/editor i have been reading about is a big deal. I also noticed he has a good library of other scripts i will try like the financial manager. I also like that he has a clear speaking voice and her explains what he is doing while he goes along. There are some none english speaking guys who also know what they are doing but its very difficult to understand them
Please, can I get the GitHub repo to this project. If you don't mind me asking, what other features do you think can be added to this project to better serve a visually impaired user and How?
It's quite depressing that NeuralNine hasn't reached 1M subscribers......your tutorials are the best...I used that one for sockets for my project..thank you for your dedication
This is very nice!
There are some models out there that can write code,
So image, you tell it to do something new, a new intent, and then it asks "how to do this?" and you tell it, then it creates a function from your commands, and learns how to do more and more tasks.
Of course, you must first give it some tools, like how to google stuff and run image recognition models.
At some point, it will have enough tools to learn tasks by itself.
For example, you tell it to press the exit button on the ad.
At first, it doesn't know what a button or an ad is, let alone the exit button on the ad. But by this time, it should already know how to search stuff on the internet, get images of buttons, specifically exit buttons, and do what you ask of it, and it should record the actions it made. From here on out, when you tell it something new, it can manage by itself or will need minimal instructions.
man i love this guy, the videos he makes are soo useful and entertaining
thanks brother ^^
This is officially the coolest channel on UA-cam ever.
That's awesome. My whole channel is dedicated to building my own digital assistant using Python named SHANE like Jarvis from the Iron Man movies and comics. Many of your videos gave me good ideas.
Happy to hear that :)
code seems to not be working on my end i keep getting the error code line 111, in
assistant.train_model() is anyone can help would be appreciated. ive went through the comments and checked google with no answers to solve thanks in advance
Bro have you got any solution to this?... I'm facing the same error
@@amayshah6090 I also have the same issue. Can someone please give the solution
Why did not this man has not already 1mil? You tube sucks! You rock bro! Keep going!
love the organized simplicity! I'm sure it's something easily accomplished, but is there a way to add a "wake word" to listen for before processing any requests?
He covered the wake word in another video
I get this error when i run the code : ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (24, 2) + inhomogeneous part. Can someone help?
did you find a solution
Great video ! just one more additive value , you could actually create a function that executes the speaker instead of runing it everytime you want to desplay a certain text into a voice format, as in the following function :
def speaker(text):
engine.say(text)
engine.runAndWait()
speaker( ' Hello World')
Can you please provide me code for virtual assistant in python using pycharm
Finally! Someone with useful content. Thank you, NeuralNine!!!
I love this guy 💖😍
He always come with different ideas and blow our mind ❤️
which software or app u are using for the program is it pycharm
Great video, very instructive!
I have an issue though when running this completed code:
File "C:/..../main.py", line 46
with open(filename, 'w') as f:
^
IndentationError: unindent does not match any outer indentation level
Process finished with exit code 1
I checked the whole code and there's no space/tab conflicts..
any help would be greatly appreciated!
Can you send whole code
Sir i have executed my code using your library. but i keep getting the below error. as the latest version doesn't support old versions of tensorflow. what is the solution for this?
ValueError: decay is deprecated in the new Keras optimizer, pleasecheck the docstring for valid arguments, or use the legacy optimizer, e.g., tf.keras.optimizers.legacy.SGD.
I’m starting with the Voice assistant and working my way to making AI. I need my computer to hear me , and be able to tell me what exactly is doing, the voice assistance is a great place to start
Who needs human friends when you can code your own :D
Brother, I don't know much about python, but you helped me a lot in making one assistant for myself. Thanks. And yea you earned a sub!
I get this error:
Exception has occurred: TypeError
string indices must be integers
File "***\main.py", line 106, in
assistant.train_model()
Anybody know how to fix it?
Or where can i find the full code?
The only dislike was someone slipping his finger! Keep up king :)
Epic video dude. Looking forward to seeing that zoom clone
Already coded and recorded :)
@@NeuralNine Wow! Can't wait for the upload! : )
@@NeuralNine what! Pls upload it as fast as possible
@@codewithyug1129 Have to keep the schedule ^^
@@NeuralNine ok 👌. Anyway, I am waiting
Best video,
but can you show how to add voice enabled web searching on google in the same virtual assistant?
This is the best video I was searching
Unindent amount does not match previous indentPylance
No quick fixes available
i am getting this problem in line [48,9]
pls help
How can the tts engine output the responses defined in intents.json ?
Also wondering that
did you figure it out?
thanks very much for this excellent tutorial, I've learned a lot, I was able to code my first Ai assistant because of you, looking forward for more interesting content...THANKS
can you please share the code
Exception has occurred: ModuleNotFoundError
No module named 'neuralintents'
Can you please resolve this error
I have already installed the module it showing as "already satisfied" then too I am getting this error
you have to get the 3.10.2 python bro
you are the best your ideas blow our minds soon you will reach 100k subscribers best of luck for your upcoming videos
Hi can someone help me. I've got an error on the line that says:
assistant = GenericAssistant('intents.json', intent_methods=mappings)
and I can't figure out where I I've gone wrong. No other errors have cropped up in the code and when you comment it out the program runs fine until you talk to it. This has led me to believe that this is the only error. Can someone please try and help me
@@Loki-wv3bx No I didn't
Couldnt figure out how
assistant = BasicAssistant('intents.json', method_mappings = mappings) might fix it
You'll have to replace that line of code with this one.
Great voice assistant!
i have a problem, at the start it says that neural intents and pyttsx3 dont work because of 'conflicting dependencies' do you know how to fix it?
I really liked the video and information. My only issue or (run problem) was that GenericAssistant could not be resolved. As I didn't have the neurialintents you set to import for GenericAssistant. I did build the Intents List that you showed. But I'm too much of a noob to make your coding work.
Maybe you can show us how your nurialintents were created so we can make the rest of what you shower us work..
Thx..
can you help me i get null byte error when i type in from neuralintents import GenericAssistant
@@muhammadasjadchaudary445 sorry I cant help. I never received the info I requested from the original poster of the video.. which is a shame as I thought this was really promising.. something is missing in the code that I cant figure out..
@@kevinschilling6813 no worries I made my own with javascript:)
very nice, please add wakeword so assistant can standby all the time
Hey there, its say that the assistant has no attribute called "train_model" What do I do?
Like, this is so confusing.
Awesome content. Favorite channel right now.
When the video started I thought we wouldn't get the "what is going on guys and today we're going to build a thing so let us get right into it," but he didn't disappoint.
Brazil here ✋ Nice video!!
thank you ^^
Thanks for the video. I learned a lot. Terminal says there is a mistake in your 'neural intents' main.py.
line 67, in train_model for intent in self.intent['intents']:
TypeError: string indices must be integers. Can anyone help?
same problem I am facing
if you have got solution please tell me
Pyttsx3 never works for me, it always show some traceback errors on a lot of files
hi
i am getting an error in line 1 of generic assistant
from neuralintents import GenericAssistant
Error using selected REPL back-end:
IPython mode requires IPython 0.11 or later: No module named 'IPython'
Using standard backend instead
>>>
Did you get the solution
I am waiting for the video conferencing app which has mic recognition. Awesome VIDEO. Now I am not going to be lonely in the lockdown.
Zoom clone coming soon :D
@@NeuralNine wohoooo
@@NeuralNine when do you think you will upload it?
can you do a video how to install your pycharm because mine is doesnt work properly my codes are right but the pycharm doest work well
Well, there is a community version
, and a pro version. When you go into your code, you'll have to open it as a project so its not in light editing mode. From there you can run and test the code.
Great video dude, I would also be interested if you could do a more advanced ai, like an update to this one, which can gather infos like time, date, weather, etc. Love ur video keepcup
Hey great video and thanks for sharing your knowledge, it's been essential in learning.
I do have a question...
Wouldn't the "response" be a bit more organic if there were several choices to train? I think I answered my own question or at least something I'm willing to test now 😂
Thanks again!
Not going to lie, your "NeuralIntents" module is quite dope. Where are the models saved? It would be cool if we could "save it for later". Keep up the great work.
I can't get it on my computer can you help me?
you can by using the .save_model() method on the assistant object
I'm just seeing the fourth industrial revolution with my own eyes, it's just majestic.
did u make the intents.json or did it come when u installed neuralintents cuz it didnt happen with me :)
YOu have to make it
Hello friend, I'm from Brazil, first of all I would like to thank you for the excellent neuralintents module and for the best py ai video, very simple and with a very clean code, congratulations. i'm still not very good at py i've been studying for a while, i have a question how would you make speaker tts speak intents.json's responses instead of displaying it in the console?
do you still need an answer?
@@strobel273 please can you answer me my system cant find my .json
@@sanjoetv5748 pls send me your code
@@strobel273 can u send your code pleas
I keep getting this error message when I run the code, please help:
File "c:\Users\DANIEL\Voice_Assist\main.py", line 114, in
assistant.train_model()
File "C:\Users\DANIEL\pyver\py311\Lib\site-packages
euralintents\main.py", line 97, in train_model
training = np.array(training)
^^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (30, 2) + inhomogeneous part.
Amazing content as always! Really appreciate your efforts. We learn a lot from you. I was wondering if it's possible to use gtts instead of pyttsx3 because the voice sounds too "robotic"
Yes it is possible, just Google or check the docs to find out the commands for that module! ;)
Hello, I have a question... how do you make your AI assistant to say responses from the "responses" in the json file??
I am having trouble installing neuralIntents*
which IDE are u using?
Also in my pc I can't download any packages I tried pip install flask
but it didn't work
Is this because I have windows 7?
He is using pycharm. If you are on windows, you need to add python to path to use its commands.
I am using PyCharm
He is using PyCharm. In order to use pip commands you need to have python installed. And Also check your environment variables and PATH.
@@MrREALball I have installed python 2.8.1 (because the later versions are not supporting) and also have installed pycharm
@@pokegamerspoint6577 just type pip in terminal, what do you get ?
it is not working when downloading speech recognition this is coming up !!!
AttributeError: module 'tokenize' has no attribute 'open'
im unable to import the Genericassistant and the other modules.
could you provide a github link to your project, because its not workling for me but i would love to use your code as an example.
"from neuralintents import GenericAssistant" doesnt work for me i did pip install but i got this ERROR: Cannot install neuralintents==0.0.1, neuralintents==0.0.2, neuralintents==0.0.3 and neuralintents==0.0.4 because these package versions have conflicting dependencies.
same problem here
I did your same code. But assistant is not responding? What can I do?
idk if anyone got this error but when running the program it tells me that there No such file or directory: 'intents.json' whereas it is in the same directory. Really great content btw thank you !!
I manage to solve it? I have the same error
you might need to specify the full path
hey, thanks for this but I e run into a problem :(
when I try importing GenerisAssistant from neuralintents it throws errors.
unresolved reference 'neuralintents'
unresolved reference 'genericassistant'
pleased help. thanks
Despite installing neuralintents with pip and not seeing any issues when I try to run I have the same issues. The error I receive is: from neuralintents import GenericAssistant
ModuleNotFoundError: No module named 'neuralintents'
It looks like a great project but going to need some help to resolve.
Love the video man, how would I make a wake word for the assistant ?
Have you tried an if statement? In a previous chatbot I made, I used pyttsx3 and speech recognition to create a variable named query which is a text version of the words the user said. and then I used an If statement that basically said If wakeword(either a variable or just a string in quotes) in query: then it runs the code where the chatbot does its process of responding. and then I put an else: that would print "waiting for wakeword " at the end for testing purposes.
-- hope this helps!
If anyone's had a problem where it doesn't appear to work on Ubuntu Linux 20.04, if using pycharm then make sure to add 'import pyaudio' at the top and additionally, please make sure your microphone is turned on (took me 10 hours of debugging until I found out this was the issue xD).
do we have to install pyaudio? or does it work by just putting import pyaudio?
it throws me this error "Could not find PyAudio; check installation
During handling of the above exception, another exception occurred:
File "C:\Users\panda2\OneDrive\Desktop\programmi\Assistant.py", line 115, in
with speech_recognition.Microphone() as mic:" how can I fix it?
Hello!
I need help pls.
I'm having trouble installing neuralintents package.
Glad I found this channel
Help please I'm trying to install neuralintents and I wrote everything right but it gave me this code:
Collecting neuralintents
Using cached neuralintents-0.0.4-py3-none-any.whl (5.0 kB)
Using cached neuralintents-0.0.3-py3-none-any.whl (5.0 kB)
Using cached neuralintents-0.0.2-py3-none-any.whl (4.3 kB)
Using cached neuralintents-0.0.1-py3-none-any.whl (2.6 kB)
ERROR: Cannot install neuralintents==0.0.1, neuralintents==0.0.2, neuralintents==0.0.3 and neuralintents==0.0.4 because these package versions have conflicting depend
encies.
help would be appreciated
Did u write exactly pip install neuralintents in to the correct console (the one u usualy use for the pip installs)?
Amazing intro @NeuralNine
thanks brother :)
aaaaaaaaaahhh there goes 500MB of space ...damn didnt see that one coming
lol
Im abit of a noob at this. i installed the files with pip but when i try to import them in the IDE there are errors and it cant find the references. I am assuming that the location i installed the files with pip is different to what my IDE is pulling from. can someone help me change this ? and correct me if I'm wrong ?
quit() ist übrigens wie exit() in Python auch Standart
Great video. But l have a question please, is there a way that if you don't say any command, the voice would tell you a message like 'I didn't hear any instructions'
How do I speak a long series of actions . For instance , hey bro I want you to turn on my lights on bedroom 1, make sure the dogs are fed every half hour. Just do this series of actions for a couple of days while I am out.
Thanks for the video, great content! quick question though, is anyone else running into the issue where changes to intent.json don't seem to apply? my bot keeps saying "what can i do for you" even though it's no longer in there.
yes i too see the same issue
@@INDRA7978 I've figured out the issue and am trying to find a 'clean' solution. The issue is located within the greeting function, not the json. The speaker.say() parameter is the line we keep hearing instead of the corresponding responses registered within the json. pyttsx3 documentation isn't giving me much to work with though..
I just found the fix as well, where .say() is meant to 'speak' the given string, .request() actually picks an option from the list you provide in the json. don't forget to add runAndWait(), otherwise you won't hear anything. Happy coding~
hi neuralnine, keep up the great work :)
You write 129 lines of code without running it. It looks a little bit fake and hard to understand what does that part of code.
However this video helped me, thanks.
how to solve the two errors that appears at the start when you run the program at 22:15 ? "VisibleDeprecationWarning" and "UserWarning"
I am getting latency issues in getting output from bot. How can I improve that?
it takes more time to download your module neuralinest
great video, can you upload the whole on your Github?
thanks!
When loading the model (valueerror: unrecognized type code -1)
why is that error comes everytime
i've installed neuralintents already and it is still giving me the errors ,also with genericAssistant and speechrecognition and pyttsx3
how may I fix it Please help me with it
i tried to download neuralintents but if it comes to 101mb and then is start showing error
It doenst seem to be listening even tho my code is excactly like yours (I basically deleted all my own code just to test if it is something i messed up there) it seems like the error is at recognizer.listen(mic)
Is the Neuralintents working for apple silicon? I keep getting this come up: Process finished with exit code 132 (interrupted by signal 4: SIGILL) ... And when I looked it up, some were saying it's to do with
arm64 or some compatibility error. I'm confused...
Sir. I am working on a project and I am stuck at something.. Can we get the TAG as output ? I mean return "tag" which I mentioned in the intents.json file from the GenericAssistant... actually I wanted to do apply it in if/else statements not in functions.. like that.....
That was epic good work !!!!!
Hi, is it possible to open a picture saved in my pc and see the picture while voice assistant is talking about it? Thank you.
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
Traceback (most recent call last):
File "c:\Users\Demia\Aichatbot\Aichatbot Code.py", line 125, in
assistant = GenericAssistant('intents.json', intent_methods=mappings)
File "C:\Python310\lib\site-packages
euralintents\main.py", line 53, in __init__
self.load_json_intents(intents)
File "C:\Python310\lib\site-packages
euralintents\main.py", line 58, in load_json_intents
self.intents = json.loads(open(intents).read())
FileNotFoundError: [Errno 2] No such file or directory: 'intents.json
ah yes, now I will have intelligent voice assistant which will always tell me to write comments on my code
let's go
while True: say("Add comments to your code") :D
@@NeuralNine OMEGALUL
It doesn't work for my. When i press run, it just does nothing.
Great video. I'm trying to use the static responses from the json intents file but it won't work. How do I get a string response from a specific tag in Json file and pass it to my text_to_speech function?
Did you ever figure this out?
what is the command to get the basic structure of project??
when executing
f.mp3 is not recognized as an internal or external command operable program or
bath file
Please what is that solution
Hey! Your videos are quite helping. I want the gtts model to speak in some specific voice instead of default google lady. I want to save the input text in my own audio. How can I do that? Please help...
thanks for the video! works very well
How to install:
py -m pip install speechrecognition
py -m pip install pyttsx3
py -m pip install neuralintents
cant do pip install neuralintents its giving me an error
ERROR: Cannot install neuralintents==0.0.1, neuralintents==0.0.2, neuralintents==0.0.3 and neuralintents==0.0.4 because these package versions have conflicting dependencies
when I run it I say hello but is says nothing back
My class mate told me that i have to make new friends, and i took that personally:
Does anyone know the versions he uses in these videos? im trying to recreate a lot of this stuff but i cant find the correct combination of versions to make anything work