This file contains 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
BEGIN TRANSACTION; | |
DROP TABLE IF EXISTS "actors"; | |
CREATE TABLE IF NOT EXISTS "actors" ( | |
"actor_id" INTEGER, | |
"name" TEXT, | |
PRIMARY KEY("actor_id") | |
); | |
DROP TABLE IF EXISTS "roles"; | |
CREATE TABLE IF NOT EXISTS "roles" ( | |
"role_id" INTEGER, |
This file contains 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
mkdir -p adapter/in adapter/out application/port/in application/port/out application/service domain; | |
touch adapter/in/.gitkeep adapter/out/.gitkeep application/port/in/.gitkeep application/port/out/.gitkeep application/service/.gitkeep domain/.gitkeep |
This file contains 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
### IMPORTS ### | |
from datetime import datetime | |
from random import random, randint | |
import uuid | |
from faker import Faker | |
import numpy as np | |
import pandas as pd | |
from sqlalchemy import create_engine | |
from tqdm import tqdm |
This file contains 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
version: "3" | |
services: | |
jupyter: | |
image: jupyter/scipy-notebook | |
ports: | |
- 8888:8888 | |
volumes: | |
- jp_vol:/home/jovyan/work |
This file contains 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 | |
import numpy as np | |
from matplotlib.colors import ListedColormap, to_rgba_array | |
import matplotlib.pyplot as plt | |
from scipy.stats import multivariate_normal | |
from sklearn.mixture import GaussianMixture | |
# Config | |
%config InlineBackend.figure_format = 'retina' | |
%matplotlib inline |
This file contains 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 numpy as np | |
foo = np.array([ | |
[1, 2, 3], | |
[1, 2, 3], | |
[1, 2, 9], | |
]) | |
bar = [1, 2, 3] |
This file contains 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
# A little snippet to show how to use sklearn transformer interface | |
# to extract NLP features | |
# necessary imports | |
import pandas as pd | |
from sklearn.base import TransformerMixin | |
from sklearn.pipeline import FeatureUnion | |
# load your dataset | |
df_train = pd.read_csv("./data/train/cwi_training.txt", sep="\t", names=["sentence", "word", "index", "label"]) |