2016-10-10から1日間の記事一覧

パーフェクトjavaを読む

13章まで終了

言語処理100本ノック

05. n-gram 与えられたシーケンス(文字列やリストなど)からn-gramを作る関数を作成せよ.この関数を用い,"I am an NLPer"という文から単語bi-gram,文字bi-gramを得よ def n_gram(s,n): sentence = s.split() result = [] len_sentence = len(sentence) f…