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 json | |
import argparse | |
from collections import defaultdict, Counter | |
def parse_args(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--input", type=str, required=True, | |
help="jsonl形式のデータ") | |
args = 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
import json | |
s = '[1, 2, 3]' | |
l = json.loads(s) |
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
# pip install unidic-lite | |
# /home/ユーザー名/.pyenv/versions/3.9.0/envs/evaluate_mlm/lib/python3.9/site-packages/unidic_lite/dicdir/ みたいな | |
# 箇所に辞書が作られるのでそこにパス通す. | |
import MeCab | |
tagger = MeCab.Tagger('-r /dev/null -d /home/ユーザ名/.pyenv/versions/3.9.0/envs/evaluate_mlm/lib/python3.9/site-packages/unidic_lite/dicdir -Owakati') | |
tagger.parse('これはペンです.') |
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
brew install openblas | |
OPENBLAS="$(brew --prefix openblas)" pip install numpy |
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
# 共有可能なリンクを取得からFILE_IDを取得する | |
FILE_ID=1uoAReQK3f5g9CEy8rV4haSzXll8NqVHW | |
FILE_NAME=gfm-models.zip | |
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=${FILE_ID}" > /dev/null | |
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)" | |
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=${FILE_ID}" -o ${FILE_NAME} |
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
from glob import glob | |
for file_name in glob('../../*.txt'): | |
print(file_name) |
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
# file_path=../data/hoge.bin | |
# file_name=hoge | |
file_name=$( echo $file_path | cut -d/ -f4 | sed -r 's/(.[^.]+){1}$//g') |
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
from ast import literal_eval | |
s = '[1, 2, 3, 4]' | |
l = literal_eval(s) |
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
" This is Gary Bernhardt's .vimrc file | |
" vim:set ts=2 sts=2 sw=2 expandtab: | |
" remove all existing autocmds | |
autocmd! | |
" initialize plugins | |
call plug#begin('~/.vim/plugged') | |
Plug 'vim-ruby/vim-ruby' | |
Plug 'slim-template/vim-slim' |
NewerOlder