from nltk.tokenize import sent_tokenize, word_tokenize
from nltk.corpus import stopwords
import speech_recognition as sr
import nltk
from google_images_download import google_images_download 
response = google_images_download.googleimagesdownload()
r = sr.Recognizer()
with sr.Microphone() as source:
    print("Say something!")
    audio = r.listen(source)
    
data = r.recognize_google(audio).encode("utf-8")
print (data)
stopWords = set(stopwords.words('english'))
words = word_tokenize(data)
wordsFiltered = []

for w in words:
    if w not in stopWords:
        wordsFiltered.append(w)
 
into_string = str(wordsFiltered)
print(into_string)
arguments = {"keywords":into_string,"limit":2,"print_urls":True}   #creating list of arguments
response.download(arguments)   #passing the arguments to the function
[((6, 11, 6, 56), 'google_images_download.google_images_download.googleimagesdownload', 'google_images_download.googleimagesdownload', ({}, {}), '()', False, 'from google_images_download import google_images_download\n'), ((7, 4, 7, 19), 'speech_recognition.Recognizer', 'sr.Recognizer', ({}, {}), '()', True, 'import speech_recognition as sr\n'), ((15, 8, 15, 27), 'nltk.tokenize.word_tokenize', 'word_tokenize', ({(15, 22, 15, 26): 'data'}, {}), '(data)', False, 'from nltk.tokenize import sent_tokenize, word_tokenize\n'), ((8, 5, 8, 20), 'speech_recognition.Microphone', 'sr.Microphone', ({}, {}), '()', True, 'import speech_recognition as sr\n'), ((14, 16, 14, 42), 'nltk.corpus.stopwords.words', 'stopwords.words', ({(14, 32, 14, 41): '"""english"""'}, {}), "('english')", False, 'from nltk.corpus import stopwords\n')]