Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python chatbot speech recognition

import ioimport randomimport stringimport warningsimport numpy as npfrom sklearn.feature_extraction.text import TfidfVectorizerfrom sklearn.metrics.pairwise import cosine_similarityimport warningsfrom gtts import gTTSimport oswarnings.filterwarnings('ignore')import speech_recognition as sr import nltkfrom nltk.stem import WordNetLemmatizer#for downloading package files can be commented after First runnltk.download('popular', quiet=True)nltk.download('nps_chat',quiet=True)nltk.download('punkt') nltk.download('wordnet')
Source by blog.usejournal.com #
 
PREVIOUS NEXT
Tagged: #python #chatbot #speech #recognition
ADD COMMENT
Topic
Name
4+8 =