Skip to content

Instantly share code, notes, and snippets.

View sdoshi579's full-sized avatar

Sanket sdoshi579

View GitHub Profile
@sdoshi579
sdoshi579 / NLP Basics
Last active January 21, 2019 18:17
Natural Language Processing Basics Uses Nltk package and shows tokenization and lemmatization
import nltk
nltk.download()
import nltk
from nltk.tokenize import RegexpTokenizer
text = 'Citizens of India are known as Indians.'
# By passing r'\w+' to the RegexpTokenizer
import fastText
import sys
import os
import nltk
nltk.download('punkt')
import csv
import datetime
from bs4 import BeautifulSoup
import re
import itertools
@sdoshi579
sdoshi579 / Digit-recignizer-using-CNN.py
Created March 31, 2019 11:06
Using Keras to implement CNN model which would recognize hand-written digits
%pylab inline
import os
import numpy as np
import pandas as pd
from scipy.misc import imread
from sklearn.metrics import accuracy_score
import tensorflow as tf
import keras
from keras.layers import Dense, Dropout, Flatten
@sdoshi579
sdoshi579 / Music-classification-into-genres.py
Created April 4, 2019 16:56
Model generated to classify extracted features from music clips into different genres
import librosa
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import os
import csv
# Preprocessing
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder, StandardScaler
@sdoshi579
sdoshi579 / Predicting-Traffic-Signs-using-CNN.py
Created September 1, 2019 10:56
Predicting the traffic signs by building CNN model using Keras
import os
import pandas as pd
from scipy.misc import imread
import math
import numpy as np
import cv2
import keras
import seaborn as sns
from keras.layers import Dense, Dropout, Flatten, Input
from keras.layers import Conv2D, MaxPooling2D
@sdoshi579
sdoshi579 / Latent_semantic_analysis.py
Created February 26, 2020 04:43
Find the hidden topics represented by the documents using LSA
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
import nltk
from sklearn.decomposition import TruncatedSVD
# If nltk stop word is not downloaded
# nltk.download('stopwords')
from nltk.corpus import stopwords
# List of documents
a1 = "He is a good dog."