ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
parser
trees
evalb.h
Go to the documentation of this file.
1
9
#ifndef META_PARSER_EVALB_H_
10
#define META_PARSER_EVALB_H_
11
12
#include "
parser/trees/parse_tree.h
"
13
14
namespace
meta
15
{
16
namespace
parser
17
{
18
25
class
evalb
26
{
27
public
:
31
uint64_t
matched
()
const
32
{
33
return
proposed_correct_
;
34
}
35
39
uint64_t
proposed_total
()
const
40
{
41
return
proposed_total_
;
42
}
43
47
uint64_t
gold_total
()
const
48
{
49
return
gold_total_
;
50
}
51
55
double
labeled_precision
()
const
56
{
57
return
static_cast<
double
>
(
matched
()) /
proposed_total
() * 100;
58
}
59
63
double
labeled_recall
()
const
64
{
65
return
static_cast<
double
>
(
matched
()) /
gold_total
() * 100;
66
}
67
71
double
labeled_f1
()
const
72
{
73
return
2 * (
labeled_precision
() *
labeled_recall
())
74
/ (
labeled_precision
() +
labeled_recall
());
75
}
76
81
double
perfect
()
const
82
{
83
return
static_cast<
double
>
(
perfect_
) /
total_trees_
* 100;
84
}
85
89
double
average_crossing
()
const
90
{
91
return
static_cast<
double
>
(
crossed_
) /
total_trees_
;
92
}
93
97
double
zero_crossing
()
const
98
{
99
return
static_cast<
double
>
(
zero_crossing_
) /
total_trees_
* 100;
100
}
101
106
void
add_tree
(
parse_tree
proposed,
parse_tree
gold);
107
108
private
:
112
uint64_t
proposed_correct_
= 0;
113
117
uint64_t
proposed_total_
= 0;
118
122
uint64_t
gold_total_
= 0;
123
127
uint64_t
perfect_
= 0;
128
132
uint64_t
crossed_
= 0;
133
137
uint64_t
zero_crossing_
= 0;
138
142
uint64_t
total_trees_
= 0;
143
};
144
}
145
}
146
#endif
meta::parser::evalb::perfect_
uint64_t perfect_
The number of parse trees that were perfect matches with gold trees.
Definition:
evalb.h:127
meta::parser::evalb::matched
uint64_t matched() const
Definition:
evalb.h:31
meta::parser::evalb::labeled_recall
double labeled_recall() const
Definition:
evalb.h:63
meta::parser::parse_tree
Represents the parse tree for a sentence.
Definition:
parse_tree.h:32
meta::parser::evalb::proposed_total
uint64_t proposed_total() const
Definition:
evalb.h:39
parse_tree.h
meta::parser::evalb::labeled_f1
double labeled_f1() const
Definition:
evalb.h:71
meta::parser::evalb::add_tree
void add_tree(parse_tree proposed, parse_tree gold)
Definition:
evalb.cpp:130
meta::parser::evalb::zero_crossing_
uint64_t zero_crossing_
The total number of proposed trees that had no crossings.
Definition:
evalb.h:137
meta::parser::evalb::proposed_correct_
uint64_t proposed_correct_
The number of correct constituents in proposed parse trees.
Definition:
evalb.h:112
meta::parser::evalb::proposed_total_
uint64_t proposed_total_
The number of total constituents in proposed parse trees.
Definition:
evalb.h:117
meta::parser::evalb::average_crossing
double average_crossing() const
Definition:
evalb.h:89
meta::parser::evalb::labeled_precision
double labeled_precision() const
Definition:
evalb.h:55
meta::parser::evalb::gold_total
uint64_t gold_total() const
Definition:
evalb.h:47
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::evalb::zero_crossing
double zero_crossing() const
Definition:
evalb.h:97
meta::parser::evalb::gold_total_
uint64_t gold_total_
The number of total constituents in gold parse trees.
Definition:
evalb.h:122
meta::parser::evalb::perfect
double perfect() const
Definition:
evalb.h:81
meta::parser::evalb::crossed_
uint64_t crossed_
The total number of crossings in proposed trees.
Definition:
evalb.h:132
meta::parser::evalb
A re-implementation of (some of) the evalb metrics.
Definition:
evalb.h:25
meta::parser::evalb::total_trees_
uint64_t total_trees_
The total number of parse trees.
Definition:
evalb.h:142
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1