-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathevaluation.cpp
More file actions
33 lines (30 loc) · 811 Bytes
/
Copy pathevaluation.cpp
File metadata and controls
33 lines (30 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "evaluation.h"
#include <QString>
EvaluationResults::EvaluationResults()
{
clear();
}
/*!
* \brief Calculates precision and recall.
*
* Replaces the values of m_total_recall and m_total_precision by new values.
*/
void EvaluationResults::calculate_precision_recall()
{
m_total_precision = (double) m_true_positive_count / (double) m_retrieved_parse_count;
m_total_recall = (double) m_true_positive_count / (double) m_gs_parse_count;
}
/*!
* \brief Resets values to 0 (of -1, if that value may be a denominator).
*/
void EvaluationResults::clear()
{
m_total_recall = 0;
m_total_precision = 0;
m_gs_word_count = 0;
m_retrieved_word_count = 0;
m_overlap_word_count = 0;
m_true_positive_count = 0;
m_gs_parse_count = -1;
m_retrieved_parse_count = -1;
}