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
from django.db import models | |
from django.db.models import sql | |
class MySQLBulkInsertManager(models.Manager): | |
""" bulkでinsert on duplicate updateするためのマネージャー | |
""" | |
def bulk_insert_on_duplicate(self, obj_list, update_fields, batch_size=None): | |
""" Usage |
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
git clone https://github.com/atilika/kuromoji | |
git pull | |
git status | |
git branch | |
git branch -a | |
git log | |
git add . | |
git add hoge | |
git co master | |
git co -b topic/branch |
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
p(w,t|x,α,β) = p(w|t,x,α,β)p(t|x,α,β) (1) | |
p(w,t|x,α,β) = p(t|w,x,α,β)p(w|t,α,β) (2) | |
(1)(2)比較して、 | |
p(w|t,x,α,β) = p(t|w,x,α,β)p(w|t,α,β) / p(t|x,α,β) | |
ここで、 | |
分子の p(t|w,x,α,β) = p(t|w,x,β) (式1.65から、w固定時にα固定されるので) | |
分子の p(w|t,α,β) = p(w|α) (式1.65から) | |
両辺をwの関数だと思えば、分母p(t|x,α,β)は定数なので、 |
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 perl | |
use strict; | |
use warnings; | |
use utf8; | |
use 5.012000; | |
use autodie; | |
use Math::Random; | |
use Statistics::Descriptive; | |