コード例 #1
0
ファイル: maxentmodel.cpp プロジェクト: izenecloud/icma
/**
 * Load a MaxentModel from a file.
 *
 * @param model The name of the model to load
 */
void MaxentModel::load(const string& model) {
    MaxentModelFile f;
    f.load(model);
    m_pred_map = f.pred_map();
    m_outcome_map = f.outcome_map();
    f.params(m_params, m_n_theta, m_theta);
}
コード例 #2
0
ファイル: trainer.cpp プロジェクト: SnakeHunt2012/ltp
/*
 * Load training data.
 *
 * @param events the file name of
 */
void Trainer::load_training_data(const string& events, const string& model) {
    shared_ptr<MEEventSpace> e(new MEEventSpace);
    load_events_txt(events, *e);

    MaxentModelFile f;
    f.load(model);
    f.params(m_params, m_n_theta, m_theta);

    m_es = e;
}
コード例 #3
0
ファイル: test_modelfile.cpp プロジェクト: zbxzc35/maxent-1
char* 
test_bin_model() {
    MaxentModelFile f;
    f.load("data/me_model.txt");
    f.save("data/model_temp", true);

    MaxentModelFile f2;
    f2.load("data/model_temp");
    return check_model(f2);
}
コード例 #4
0
ファイル: test_modelfile.cpp プロジェクト: zbxzc35/maxent-1
char* 
test_save() {
    MaxentModelFile t;
    // BOOST_CHECK_THROW(t.save("no this model", false), runtime_error);

    {
        MaxentModelFile f;
        f.load("data/me_model.txt");
        f.save("data/model_temp", false);

        MaxentModelFile f2;
        f2.load("data/model_temp");
        return check_model(f2);
    }
}
コード例 #5
0
ファイル: test_modelfile.cpp プロジェクト: zbxzc35/maxent-1
MaxentModelFile* 
load_model(const string& file) {
    MaxentModelFile* f = new MaxentModelFile();
    f->load(file);
    return f;
}