ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
parser
state_analyzer.h
Go to the documentation of this file.
1
9
#ifndef META_PARSER_STATE_ANALYZER_H_
10
#define META_PARSER_STATE_ANALYZER_H_
11
12
#include "
parser/sr_parser.h
"
13
#include "
parser/state.h
"
14
15
namespace
meta
16
{
17
namespace
parser
18
{
19
24
class
sr_parser::state_analyzer
25
{
26
public
:
30
feature_vector
featurize
(
const
state
&
state
)
const
;
31
32
private
:
38
void
unigram_featurize
(
const
state& state,
feature_vector
& feats)
const
;
39
45
void
bigram_featurize
(
const
state& state,
feature_vector
& feats)
const
;
46
52
void
trigram_featurize
(
const
state& state,
feature_vector
& feats)
const
;
53
59
void
children_featurize
(
const
state& state,
feature_vector
& feats)
const
;
60
66
void
dependents_featurize
(
const
state& state,
feature_vector
& feats)
const
;
67
74
void
unigram_stack_feats
(
const
node
* n, std::string prefix,
75
feature_vector
& feats)
const
;
76
85
void
bigram_features
(
const
node
* n1, std::string name1,
const
node
* n2,
86
std::string name2,
feature_vector
& feats)
const
;
87
96
void
child_feats
(
const
node
* n, std::string prefix,
feature_vector
& feats,
97
bool
doubs)
const
;
98
};
99
}
100
}
101
102
#endif
meta::parser::sr_parser::state_analyzer::bigram_features
void bigram_features(const node *n1, std::string name1, const node *n2, std::string name2, feature_vector &feats) const
Adds bigram features to the feature vector.
Definition:
state_analyzer.cpp:105
meta::parser::node
A single node in a parse tree for a sentence.
Definition:
node.h:24
meta::parser::sr_parser::state_analyzer::trigram_featurize
void trigram_featurize(const state &state, feature_vector &feats) const
Adds trigram features.
Definition:
state_analyzer.cpp:133
meta::parser::sr_parser::state_analyzer
Analyzer responsible for converting a parser state to a feature_vector.
Definition:
state_analyzer.h:24
meta::parser::state
Represents the current parser state of a shift-reduce parser.
Definition:
state.h:36
sr_parser.h
meta::parser::sr_parser::state_analyzer::children_featurize
void children_featurize(const state &state, feature_vector &feats) const
Adds children features.
Definition:
state_analyzer.cpp:174
meta::parser::sr_parser::feature_vector
std::unordered_map< std::string, float > feature_vector
Sparse vector representation of a state's features.
Definition:
sr_parser.h:150
meta::parser::sr_parser::state_analyzer::child_feats
void child_feats(const node *n, std::string prefix, feature_vector &feats, bool doubs) const
Adds child features to the feature vector.
Definition:
state_analyzer.cpp:190
meta
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
meta::parser::sr_parser::state_analyzer::bigram_featurize
void bigram_featurize(const state &state, feature_vector &feats) const
Adds bigram features.
Definition:
state_analyzer.cpp:120
meta::parser::sr_parser::state_analyzer::unigram_stack_feats
void unigram_stack_feats(const node *n, std::string prefix, feature_vector &feats) const
Adds unigram features from the parser stack.
Definition:
state_analyzer.cpp:92
state.h
meta::parser::sr_parser::state_analyzer::unigram_featurize
void unigram_featurize(const state &state, feature_vector &feats) const
Adds unigram features.
Definition:
state_analyzer.cpp:69
meta::parser::sr_parser::state_analyzer::featurize
feature_vector featurize(const state &state) const
Maps a state to its feature vector representation.
Definition:
state_analyzer.cpp:48
meta::parser::sr_parser::state_analyzer::dependents_featurize
void dependents_featurize(const state &state, feature_vector &feats) const
Adds dependent features.
Definition:
state_analyzer.cpp:281
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1