Skip to content

Commit

Permalink
ok library example works
Browse files Browse the repository at this point in the history
  • Loading branch information
josephreisinger committed Jul 24, 2012
1 parent f151531 commit 899bb40
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vw.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/vw_py.cpp
Expand Up @@ -9,6 +9,7 @@ vw _vw;
bool _initialized = false;

void initialize(char* params) {
assert(!_initialized);
cout << "initialized with params=[" << std::string(params) << "]" << endl;
_vw = VW::initialize(std::string(params));
_initialized = true;
Expand All @@ -22,11 +23,10 @@ void finish() {
float learn(char* line) {
assert(_initialized);

// cout << "no1" << "[" << line << "]" << endl;
example* v = VW::read_example(_vw, line);
_vw.learn(&_vw, v);
float p = v->final_prediction;
VW::finish_example(_vw, v);
// cout << "no6" << "[" << p << "]" << endl;

return p;
}
Binary file added training_data/aiw.txt.gz
Binary file not shown.
Binary file added training_data/ttlg.txt.gz
Binary file not shown.

0 comments on commit 899bb40

Please sign in to comment.