Skip to content

Instantly share code, notes, and snippets.

View kangjin2014's full-sized avatar
:electron:
Focusing

Ryan J Kang kangjin2014

:electron:
Focusing
  • Toronto, Canada
View GitHub Profile
@kangjin2014
kangjin2014 / tfidf.py
Last active December 30, 2017 17:51
tfidf.py
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import train_test_split
from sklearn import linear_model
from sklearn.metrics import accuracy_score
corpus = pd.Series(group_topic).apply(lambda x : ' '.join(element for element in x))
df_train = pd.read_csv('/Users/kangjin/desktop/meetup_topic/training.csv')
df_train.columns=['index','lable','column']
Y_train = df_train['lable']
@kangjin2014
kangjin2014 / jwt.py
Last active December 15, 2017 05:45
flask jwt tutorial example
# import flask(rest api) and jwt(auth)
from flask import Flask
from flask_restful import Resource, Api
from flask_jwt import JWT, jwt_required
app = Flask(__name__)
app.config['SECRET_KEY'] = 'super-secret'
api = Api(app, prefix="/api/v1")