Improve @param docs for Database::compact()
[xapian.git] / xapian-letor / featurevector.h
blob747a3a9541880d646bcc9861a4bfe7abeea921b3
1 /* featurevector.h: The file responsible for transforming the document into the feature space.
3 * Copyright (C) 2012 Parth Gupta
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
18 * USA
21 #ifndef FEATURE_VECTOR_H
22 #define FEATURE_VECTOR_H
25 #include <xapian.h>
26 #include <xapian/intrusive_ptr.h>
27 #include <xapian/types.h>
28 #include <xapian/visibility.h>
30 #include "featuremanager.h"
32 #include <list>
33 #include <map>
35 using namespace std;
38 namespace Xapian {
40 class XAPIAN_VISIBILITY_DEFAULT FeatureVector {
42 public:
44 double label;
45 std::map<int,double> fvals;
46 int fcount;
47 string did;
50 FeatureVector();
52 FeatureVector(const FeatureVector & o);
54 virtual ~FeatureVector() {};
56 /** This method takes the document from the MSet as input and gives the feature representation
57 * as vector in the form of
58 * map<int,double>
60 // std::map<int,double> transform(const Xapian::Document & doc);
63 map<string, map<string, int> > load_relevance(const std::string & qrel_file);
65 // void set_qid(const std::string & qid);
67 void set_did(const std::string & did1);
69 void set_label(double label1);
70 void set_fvals(map<int,double> fvals1);
75 #endif /* FEATURE_VECTOR_H */