How can I make a program change tasks based on voice recognition? - python

I'm totally new to programming, maybe my problem is newbie, but I know a little bit of python. I'm trying to build robot kind of machine to do some specific work, but I want him also to answer my "hi", so I mean machines will go through code step by step and do as it say (work I going to give him) so do I need to specify after like every two line
if input_voice == "hi":
print hi
Basically I want to know how can we detect voices and reply and middle of the work, the code to do specific work,
Sorry if you don't understand, I'm very bad at explaining

Related

How can you higher your Ping with the help of Python

My friend asked me as a Joke if I can make a "programm" that will higher your ping.
So that you will have a little delay.
The Problem is that i want to this in python cause i want to learn it.
And I have less to no experience in python.
Everybody that had a clue how python works wanted me to reset the whole program to do that (like System.Threading.Thread.Sleep(1000)). But when I told them that I want to reset or delay the Internet on my computer so if I send a package to the server the answer needs +5sec to get back they had no Idea.
I have no code that could help you help me cause I only have the GUI and some irrelevant and independet other features ready.
So if anyone can show me how this in python could work or give me at least an idea how I could try it, it would be awesome.
Thanks for reading and maybe even helping :D
Leo

Python how to trigger a code when something from another program happends

i want to use python3 to make a "chat bot", but, i don't want it to be complex, i just want it to say something when someone enters the chat room imvu. Any ideas where to get some docs to read or something? Would be nice. Thank you all.
I recommend watching the YouTube channel called The Coding Train because he has done a few things with chat-bots and twitter-bots. If that's not what you're looking for do a few quick google searches on the subject "how to make a chat-bot" or something like that. there's a lot of material out there.

Python Finding stings in another program

i would like to ask for some help here. im not sure on how i could do this but here it what im trying to do.
I am trying to make a program that looks for a string in the program and tells me if its there or not.
if you have ever used Process Hacker you can right click on the program you are looking for then right click and click properties. and filter then look for the line you are looking for. well i am trying to make a program that dose it for you so i don't have to keep going threw that all the mess in process hacker.
if someone could tell me what path i need to go or help me out here please do. if you need anymore info about this please let me know and ill be glad to explain more.
have a good one.
You could do:
def textSearcher(string, wantedText):
for x in string(or whatever has the text):
if x == wantedText:
return x
And you are talking about the control f function, right?

Siri-like app: calculating similarities between a query and a predefined set of control phrases

I am trying to make a Apple Siri-like application in python in which you give it vocal commands or questions through a microphone, it determines the text version of the inputted audio, and then determines the appropriate action to take based on the meaning of the command/question. I am going to be using the Speech Recognition library to accept microphone input and convert from speech to text (via the IBM Watson Speech to Text API).
The main problem I have with it right now is that when I define an action for the app to execute when the appropriate command is given/question is asked, I don't know how to determine if the said command/question is denoting that action. Let me clarify what I mean by that with an example:
Say we have a action called hello. There are multiple ways for somebody to say "hello" to another person (or in this case, my application), such as:
"Hello"
"Hi"
"Howdy"
...Etcetera...
Of course, I want all of these ways of saying "hello" to be classified under the action of hello. That is, when someone says "hello", "hi", or "howdy", the response for the action hello should be executed (most likely just the app saying "hello" back in this case).
My first thought on how to solve this was to supply the app with all of or the most common ways to say a certain command/question. So, if I follow the previous example, I would tell the computer that "hello", "hi", and "howdy" all meant the same thing: the hello action. However, this method has a couple flaws. First off, it simply wouldn't understand ways of saying "hello" that weren't hardcoded in, such as "hey". Second off, once the responses for new commands/questions start getting coded in, it would become very tedious entering all the ways to say a certain phrase.
So then, because of the aforementioned problems, I started looking into ways to calculate the similarities between a group of sentences, and a single query. I eventually came across the Gensim library for python. I looked into it and found some very promising information on complex processes such as latent semantic indexing/analysis (LSI/LSA) and Tf-idf. However, it seemed to me like these things were mainly for comparing documents with large word counts as they rely on the frequency of certain terms. Assuming this is true, these processes wouldn't really provide me with accurate results as the commands/questions given to my app will probably be about eight words on average. I could be completely wrong, after all I know very little about these processes.
I also discovered WordNet, and how to work with it in python using the Natural Language Toolkit (NLTK). It looks like it could be useful, but I'm not sure how.
So, finally, I guess my real question here is what would be the best solution to the problem I've mentioned? Should I use one of the methods I've mentioned? Or is there a better way to do what I want that I don't know about?
Any help at all would be greatly appreciated. Thanks in advance.
P.S. Sorry for the wordy explanation; I wanted to be sure I was clear :P
This is a hard problem. It is also the subject of Task 11 of this year's set of Semantic evaluation challenges (Semeval 2017). So take a look at the task description, which will give you a road map for how this problem can be solved. The task also comes with a suite of training data, which is essential for approaching a problem like this. The challenge is still ongoing, but eventually you'll be able to learn from the solutions as well.
So the short answer to "how do I determine if some command/question is denoting a certain action" is: Use the training data from Semeval2017 (or your own of course), and write a classifier. The nltk book can help you get up to speed with writing classifiers.

Using Python to tie together a DLA AI

So, I am completely new to programming. I've been learning basic Python over the last couple weeks. I've always wanted to learn a programming language but right now my primary reason for delving into it is to Create an AI program for my man cave. Here are my Ideas which I am sure have been thought of many times before. They are just my goals:
I would like to take a pre-established open source chat bot and tie it to a Natural Language process to give it the ability to convert my speech to a text command that it can execute and at the same time take its text output and filter it through an audible speech sample (very much like SIRI). This way when I have the function of Natural Language response on, I can have basic conversations with it. I can also turn the conversational aspect off via a voice command so that the only thing it responds to is direct commands (e.g. "Gerard, please open an email, execute. Recipient, logan.wolf.ypher#gmail.com, Subject, Hello World, Body, insert text i speak.)
I would also like to have it recognize that I am there when my phone attempts to connect to the wifi.
I know that this may be a bit complicated for me at the moment but I hear the best way to learn a language is to jump on into a project you enjoy.
Does anyone have any pointers on where to start looking for a base AI or just any tips in general that you wish to give me? I'd appreciate the info very much. Thank you.
-Logan
Considering that So, I am completely new to programming, I would recommend you take a smaller part of this project and successfully implement it. For example, an email account which is checked every 1 minute and you can send textual commands to it. From there, start upgrading it to use chat, cell phone, speech-to-text, and lastly, AI. I only say this because I know the diffulculty of starting a too-ambitious project when I am new at an area (electronics, engineering, programming, language, etc...) and fail. Success, even in small steps, is better!

Categories

Resources