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.h"
18 
19 namespace meta
20 {
21 namespace io
22 {
23 namespace libsvm_parser
24 {
26 using counts_t = const std::vector<std::pair<term_id, double>>;
27 
34 class_label label(const std::string& text);
35 
43 counts_t counts(const std::string& text, bool contains_label = true);
44 
48 class libsvm_parser_exception : public std::runtime_error
49 {
50  public:
51  using std::runtime_error::runtime_error;
52 };
53 }
54 }
55 }
56 
57 #endif
counts_t counts(const std::string &text, bool contains_label=true)
Definition: libsvm_parser.cpp:28
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:26
class_label label(const std::string &text)
Extracts a class_label from a string in libsvm format.
Definition: libsvm_parser.cpp:18
Exception class for this parser.
Definition: libsvm_parser.h:48
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition: analyzer.h:24