lib/quarry/src/model/model.h in thera-0.0.7 vs lib/quarry/src/model/model.h in thera-0.0.8
- old
+ new
@@ -2,18 +2,27 @@
#define __model_h__
#include "data_set/data_set.h"
#include "data_set/example.h"
#include "classifier/classifier.h"
#include "preprocessing/text/text_pipeline.h"
+#include <iostream>
namespace Model {
class Model {
public:
DataSet::DataSet *data_set;
Classifier::Classifier *classifier;
Preprocessing::Text::TextPipeline *text_pipeline;
Model() : data_set(NULL), classifier(NULL), text_pipeline(NULL) {}
+ ~Model() {
+ if(data_set)
+ delete data_set;
+ if(classifier)
+ delete classifier;
+ if(text_pipeline)
+ delete text_pipeline;
+ }
void train(DataSet::Example *example);
void train_text(string text);
DataSet::Example *process_text(string text, bool create_features);
void add_text_example(string text, string category);