Skip to content

Instantly share code, notes, and snippets.

View Sanket758's full-sized avatar
🏠
Working from home

Sanket Gadge Sanket758

🏠
Working from home
View GitHub Profile
@Sanket758
Sanket758 / LoginRegistrationAPI.py
Created January 23, 2021 10:25
Flask API to handle Login and Registration.
from flask import Flask, jsonify, request, json
from flask_pymongo import PyMongo
from bson.objectid import ObjectId
from datetime import datetime
from flask_bcrypt import Bcrypt
# from flask_cors import CORS
# from flask_jwt_extended import JWTManager
app = Flask(__name__)
#!pip install afinn
from afinn import Afinn
afn = Afinn()
# Predicting sentiment on our reviews
sentiment_polarity = [afn.score(review) for review in test_reviews]
predicted_sentiments = ['positive' if score >= 1.0 else 'negative' for score in sentiment_polarity]
# Evaluation
from sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score, confusion_matrix
# !pip install contractions
import nltk
nltk.download('stopwords')
nltk.download('punkt')
import contractions
from bs4 import BeautifulSoup
import unicodedata
import re
import nltk
import numpy as np
# Load the csv file
df = pd.read_csv('IMDB_reviews.csv')
# Extract the reviews and sentiments
reviews = np.array(df['review'])
sentiments = np.array(df['sentiment'])
# splitting the data into train and test sets
train_reviews = reviews[:35000]
train_sentiment = reviews[:35000]
@Sanket758
Sanket758 / ml_assignment2bi.ipynb
Created September 5, 2020 14:10
ML_Assignment2BI.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sanket758
Sanket758 / ml-project-bmp.ipynb
Created August 28, 2020 16:10
ML-Project-BMP_updated.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sanket758
Sanket758 / fashion-mnist-ann.ipynb
Created August 11, 2020 18:39
Fashion-Mnist-ANN.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sanket758
Sanket758 / univariate-linear-regression.ipynb
Created April 12, 2020 15:55
Univariate Linear Regression.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sanket758
Sanket758 / machine-learning-workshop.ipynb
Created April 10, 2020 15:33
Machine Learning Workshop.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.