This is simple program to convert audio into text. I have used speec_recognition library to do it. import speech_recognition as sr r = sr.Recognizer() with sr.Microphone() as source: print("Speak Anything :") audio = r.listen(source) try: text = r.recognize_google(audio) print("You said : {}".format(text)) except: print("Sorry could not recognize what you said") Output- Speak Anything : You said : internet is required to access the Google API if there is no internet you will not be able to convert voice into text to install SpeechRecognition- https://pypi.org/project/SpeechRecognition/ one of the dependencies is PyAudio which is not supported after 3.6. For python verison 3.6+ one needs to download wheel ( https://python101.pythonlibrary.org/chapter39_wheels.html ) and install PyAudio separately. https://sta...
it is a unified approach to explain the output of any machine learning model. pip install shap ( on anaconda prompt) import xgboost import shap # load JS visualization code to notebook shap.initjs() # train XGBoost model X,y = shap.datasets. boston () model = xgboost.train({ " learning_rate " : 0.01 }, xgboost.DMatrix(X, label = y), 100 ) # explain the model's predictions using SHAP values # (same syntax works for LightGBM, CatBoost, and scikit-learn models) explainer = shap.TreeExplainer(model) shap_values = explainer.shap_values(X) # visualize the first prediction's explanation (use matplotlib=True to avoid Javascript) shap.force_plot(explainer.expected_value, shap_values[ 0 ,:], X.iloc[ 0 ,:]) The above explanation shows features each contributing to push the model output from the base value (the average model output over the training dataset we passed) to the model output. Features pushing the prediction higher are shown...
1) Automatically open web url using Selenium- get chrome driver from here- https://chromedriver.storage.googleapis.com/index.html?path=80.0.3987.106 place the chrome driver in user/username/bin location from selenium import webdriver browser = webdriver.Chrome(executable_path = '/Users/abcarp/bin/chromedriver') browser.get('https://in.linkedin.com/') sleep(10) browser.close() 2) Automatically login to Linkedin and do some action using selenium- from selenium.webdriver.common.keys import Keys # url of LinkedIn url = "https://www.linkedin.com/login?fromSignIn=true&trk=guest_homepage-basic_nav-header-signin" # path to browser web driver driver = webdriver.Chrome( '/Users/esisarp/bin/chromedriver') driver.get(url) # getting the user-name element username = driver.find_element_by_id("username") # Sending the keys for username username.s...
Comments
Post a Comment