This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| from sklearn.model_selection import train_test_split | |
| from sklearn.metrics import accuracy_score, confusion_matrix | |
| from sklearn.metrics import classification_report | |
| from sklearn.naive_bayes import MultinomialNB | |
| from sklearn.pipeline import Pipeline | |
| from sklearn.feature_extraction.text import TfidfTransformer | |
| from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer | |
| #Are the tags which we are using currently for tagging the sentences |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from nltk import tokenize | |
| import pandas as pd | |
| import csv | |
| p = '''''' | |
| sent = tokenize.sent_tokenize(p) | |
| #print(len(sentence)) | |
| #sent.to_csv('out.csv') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sklearn.tree import DecisionTreeClassifier | |
| from sklearn.neighbors import KNeighborsClassifier | |
| from sklearn.neural_network import MLPClassifier | |
| from sklearn.ensemble import RandomForestClassifier | |
| #{height, weights, shoe size} | |
| X = [[190,70,44],[166,65,45],[190,90,47],[175,64,39],[171,75,40],[177,80,42],[160,60,38],[144,54,37]] | |
| Y = ['male','male','male','male','female','female','female','female'] | |
| #Predict for this vector (height, wieghts, shoe size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from googlesearch import search | |
| import urllib.request as ur | |
| from bs4 import BeautifulSoup | |
| try: | |
| from googlesearch import search | |
| except ImportError: | |
| print("No module named 'google' found") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from googlesearch import search | |
| import urllib.request as ur | |
| from bs4 import BeautifulSoup | |
| try: | |
| from googlesearch import search | |
| except ImportError: | |
| print("No module named 'google' found") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import re | |
| import urllib | |
| import urllib.request as ur | |
| from bs4 import BeautifulSoup | |
| html_page = ur.urlopen("http://upscanthro.com/questions/") | |
| soup = BeautifulSoup(html_page) | |
| a = [] | |
| for link in soup.findAll('a', attrs={'href': re.compile("^http://")}): | |
| a.append(link) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import smtplib | |
| import pandas as pd | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.text import MIMEText | |
| mail_content = """ | |
| Question: a. What are the symptoms of Nipah?Common carriers of Nipah virus? | |
| c. Nipah is which type of virus? | |
| d. How is it spread normally? | |
| e. First place of it’s outbreak? |