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 MySQLdb | |
import itertools | |
from random import randrange, choice | |
spot_ddl = """ | |
CREATE TABLE IF NOT EXISTS spot ( | |
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, | |
name VARCHAR(10) NOT NULL, | |
seq INT NOT NULL | |
); |
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
## 本家をクローン | |
[root@docker-host gitbucket_workspace]# git clone https://github.com/......../fork-test.git | |
[root@docker-host gitbucket_workspace]# cd fork-test/ | |
[root@docker-host fork-test]# git tag | |
release_0.0.1 | |
release_0.0.2 | |
[root@docker-host fork-test]# git branch | |
* master | |
[root@docker-host fork-test]# git branch -a | |
* master |
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
yum install -y gcc patch openssl-devel zlib-devel bzip2-devel readline-devel sqlite-devel | |
curl -kL https://bootstrap.pypa.io/get-pip.py | python | |
pip install --upgrade pip | |
git clone https://github.com/yyuu/pyenv.git ~/.pyenv | |
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile | |
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile | |
exec -l $SHELL |
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
set encoding=utf8 | |
set number | |
set paste | |
set expandtab | |
set textwidth=0 | |
set tabstop=4 | |
set softtabstop=4 | |
set shiftwidth=4 | |
set autoindent | |
set backspace=indent,eol,start |
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
#!/usr/bin/env/python | |
# Usage: knbc2cabocha.py [format] | |
# convert KNB corpus to CaboCha format | |
import sys, re | |
header, data, head, body, t2c = "", "", [], [], {} | |
pat_d = re.compile (r'^\d+') | |
pat_s = re.compile (r'\s+') | |
for line in sys.stdin: | |
if line[0] == '#': |
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
#!/usr/bin/env python | |
import sys, re | |
r_sum = re.compile(r'\((\d+)/(\d+)\)') | |
acc, param = [], [] | |
for line in sys.stdin: | |
if line.split()[0] in (['precision:', 'recall:', 'sent']): | |
m = r_sum.findall(line) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys, re | |
if len (sys.argv) < 3: | |
sys.exit ("Usage: %s auto gold" % sys.argv[0]) | |
def collect_info (fn): | |
sep = re.compile (r'(?:\t|\s)*') | |
chunk, depnd = [], [] |
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
## all | |
find ../KNBC_v1.0_090925/corpus1 -type f -name "KN*" | LC_ALL=C sort | xargs cat | python ../tools/knbc2cabocha.py KNP | python ../tools/replace_pos.py mecab -d /usr/local/lib/mecab/dic/jumandic > corpus.euc | |
iconv -f EUC-JP -t UTF-8 corpus.euc > corpus | |
/usr/local/libexec/cabocha/cabocha-learn -e chunk -P JUMAN -t utf-8 corpus chunk.model; | |
/usr/local/libexec/cabocha/cabocha-learn -e dep -P JUMAN -t utf-8 corpus dep.model | |
cat corpus | python ../tools/to_sent.py | mecab -d /usr/local/lib/mecab/dic/jumandic > tagged | |
time cat tagged | cabocha -m dep.model -M chunk.model -P JUMAN -I1 -f1 > result | |
python ../tools/eval.py result corpus | |
## simple cv |
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
## all | |
find ../KNBC_v1.0_090925/corpus1 -type f -name "KN*" | LC_ALL=C sort | xargs cat | python ../tools/knbc2kyoto.py KNP | python ../tools/replace_pos.py mecab -d /usr/local/lib/mecab/dic/jumandic > corpus.euc | |
iconv -f EUC-JP -t UTF-8 corpus.euc > corpus | |
mkdir -p model/knbc && rm -rf model/knbc/* | |
jdepp -t 0 -I 1 -c corpus -m model/knbc -- -t 1 -d 2 -c 0.0008 -i 40 -p | |
jdepp -t 3 -I 1 -c corpus -m model/knbc -- -t 1 -d 2 -c 0.0008 -i 40 -p -- -s 0.02 -i 5 -t 1 | |
jdepp -t 0 -I 2 -c corpus -m model/knbc -- -t 1 -d 2 -c 0.00005 -i 40 -p | |
jdepp -t 3 -I 2 -c corpus -m model/knbc -- -t 1 -d 2 -c 0.00005 -i 40 -p -- -- -s 0.005 -i 5 -t 1 | |
cat corpus | python ../tools/to_sent.py | mecab -d /usr/local/lib/mecab/dic/jumandic > tagged |
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
$ mkdir -p ~/.vim/bundle | |
$ git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim | |
$ vim ~/.vimrc | |
" Note: Skip initialization for vim-tiny or vim-small. | |
if 0 | endif | |
if has('vim_starting') | |
if &compatible | |
set nocompatible " Be iMproved |