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 torch | |
from torch.utils.data import TensorDataset, random_split, DataLoader | |
import numpy as np | |
import warnings | |
from tqdm import tqdm_notebook as tqdm | |
from typing import Tuple | |
NUM_MAX_POSITIONS = 256 | |
BATCH_SIZE = 32 |
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 | |
import re | |
# text and label column names | |
TEXT_COL = "text" | |
LABEL_COL = "label" | |
def clean_html(text: str): | |
"remove html tags and whitespaces" | |
cleanr = re.compile('<.*?>') |
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 os | |
import requests | |
import tarfile | |
from tqdm import tqdm | |
# path to data | |
DATA_DIR = os.path.abspath('./data') | |
# path to IMDB | |
IMDB_DIR = os.path.join(DATA_DIR, "imdb5k") |
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
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
echo "ZSH=$HOME/.oh-my-zsh" >> ~/.zshrc | |
echo "source $ZSH/oh-my-zsh.sh" >> ~/.zshrc | |
echo "ZSH_THEME='robbyrussel'" >> ~/.zshrc | |
echo "plugins = (git python osx web-search vi-mode dotenv" >> ~/.zshrc | |
echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> ~/.zshrc | |
source ~/.zshrc | |
echo ".cfg" >> .gitignore | |
git clone --bare https://github.com/ben0it8/dotfiles.git .cfg/ | |
config checkout |
NewerOlder