CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
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
2018-11-20 12:25:06,998 [INFO] Accuracy=0.926402290907022 | |
2018-11-20 12:25:07,011 [INFO] Confusion Matrix: | |
t/p CARDINAL DATE EVENT FAC GPE LANGUAGE LAW LOC MONEY NORP ORDINAL ORG PERCENT PERSON PRODUCT QUANTITY TIME WORK_OF_ART | |
CARDINAL 477.0 4.0 0.0 0.0 1.0 0.0 0.0 0.0 18.0 0.0 1.0 1.0 0.0 1.0 0.0 3.0 1.0 0.0 | |
DATE 6.0 795.0 3.0 0.0 2.0 0.0 0.0 0.0 1.0 0.0 2.0 0.0 0.0 1.0 0.0 1.0 5.0 0.0 | |
EVENT 0.0 2.0 31.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.0 0.0 2.0 1.0 0.0 0.0 |
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
--- PROFILING --- | |
--- INSIDE --- | |
_unsafe_view 19 127.431us 108.259us | |
t 19 158.285us 160.697us | |
split 19 272.784us 276.931us | |
exp 19 276.274us 283.493us | |
th_sub 19 282.381us 296.449us | |
div 19 280.799us 299.139us | |
max 19 332.444us 343.678us | |
bmm 19 307.893us 362.781us |
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 torch | |
import argparse | |
from tqdm import tqdm | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--flip', action='store_true') | |
options = parser.parse_args() |
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
punctuation_words = set(['.', ',', ':', '-LRB-', '-RRB-', '\'\'', '``', '--', ';', '-', '?', '!', '...', '-LCB-', '-RCB-']) | |
currency_tags_words = set(['#', '$', 'C$', 'A$']) | |
ellipsis = set(['*', '*?*', '0', '*T*', '*ICH*', '*U*', '*RNR*', '*EXP*', '*PPA*', '*NOT*']) | |
other = set(['HK$', '&', '**']) |
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 argparse | |
import json | |
import numpy as np | |
from tqdm import tqdm | |
class Node(object): | |
def __init__(self, id, parent, label, depth=None): |
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 tree is a nested tuple representation. | |
tree = ('A', ('B', 'C')) | |
It can also be represented as a set of spans. | |
tree_spans = get_spans(tree) # {(0, 3), (1, 3)} | |
Sometimes you need to convert a string into a tree. | |
tree_str = '( A ( B C ) )' | |
tokens, transitions = convert_binary_bracketing(tree_str) |
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
tensor 1 13.868us 12.288us | |
_unsafe_view 9 68.084us 61.634us | |
t 9 88.332us 88.192us | |
split 9 141.167us 142.527us | |
exp 9 143.811us 146.658us | |
th_sub 9 151.269us 172.068us | |
div 9 151.436us 172.991us | |
bmm 9 171.693us 195.647us | |
max 9 198.883us 202.752us | |
chunk 9 240.174us 238.307us |
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 argparse | |
import json | |
import torch | |
import torch.nn as nn | |
from tqdm import tqdm | |
class Model(nn.Module): |
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 argparse | |
def run(options): | |
print(json.dumps(options.__dict__, sort_keys=True, indent=4)) | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--log', default=None, type=str) |