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
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
############################################################ | |
# | |
# テキストファイルの全ての行に共通の置換処理を行うスクリプト. | |
# | |
# 使い方: | |
# ・19,22行目付近の「置換対象の文字列」「置換後の文字列」を設定. | |
# ・下記コマンドで実行. |
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
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
############################################################################### | |
# LIBSVM(LIBLINEAR)の学習データのスケーリング(標準化)を行う. | |
# 各素性が平均0,分散1の正規分布に従うようにスケーリングする. | |
# | |
# 次のコマンドで実行できる. | |
# $ python libsvm_gaussian_scaler.py [options] | |
# [options] |
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 java.util.HashMap; | |
import java.util.Map; | |
public class NgramCreator { | |
/** | |
* 入力したtextからn-gramを生成. | |
* n-gramとその出現回数を格納したMapを返す. | |
* 生成時,半角スペースでsplitして1単語とみなす. | |
* | |
* @param text |
NewerOlder