ModErn Text Analysis
META Enumerates Textual Applications
libsvm_parser.h
Go to the documentation of this file.
1 
10 #ifndef META_LIBSVM_PARSER_H_
11 #define META_LIBSVM_PARSER_H_
12 
13 #include <string>
14 #include <utility>
15 #include <vector>
16 
17 #include "meta/config.h"
18 #include "meta/meta.h"
19 
20 namespace meta
21 {
22 namespace io
23 {
24 namespace libsvm_parser
25 {
27 using counts_t = const std::vector<std::pair<term_id, double>>;
28 
35 class_label label(const std::string& text);
36 
44 counts_t counts(const std::string& text, bool contains_label = true);
45 
49 class libsvm_parser_exception : public std::runtime_error
50 {
51  public:
52  using std::runtime_error::runtime_error;
53 };
54 }
55 }
56 }
57 
58 #endif
counts_t counts(const std::string &text, bool contains_label=true)
Definition: libsvm_parser.cpp:34
Contains top-level namespace documentation for the META toolkit.
const std::vector< std::pair< term_id, double >> counts_t
Collection of (term_id, double)
Definition: libsvm_parser.h:27
class_label label(const std::string &text)
Extracts a class_label from a string in libsvm format.
Definition: libsvm_parser.cpp:19
Exception class for this parser.
Definition: libsvm_parser.h:49
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retrieval, data mining, and other applications of text processing.
Definition: analyzer.h:25