FreeLing  4.0
Public Member Functions | Private Member Functions | Private Attributes
freeling::vis_viterbi Class Reference

The class vis_viterbi implements the viterbi algorithm given the weights of different labels, without hidden information. More...

#include <viterbi.h>

Collaboration diagram for freeling::vis_viterbi:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 vis_viterbi (const std::wstring &)
 Constructor: Create dynammic storage for the best path, loading file with model probabilities.
std::vector< intfind_best_path (std::vector< double * > &) const
 find_best_path: perform viterbi algorithm given the weights matrix

Private Member Functions

void softmax (double *p) const
 convert weights to probabilities

Private Attributes

int N
 N: number of classes.
std::vector< double > p_ini
 p_ini: vector with initial probabilities for each class
std::vector< std::vector
< double > > 
p_trans
 p_trans: matrix with the probability transitions from one class to another e.g.
bool use_softmax
 whether to use softmax to convert given weights to probabilities
double ZERO_logprob
 logprob for probability zero

Detailed Description

The class vis_viterbi implements the viterbi algorithm given the weights of different labels, without hidden information.


Constructor & Destructor Documentation

freeling::vis_viterbi::vis_viterbi ( const std::wstring &  )

Constructor: Create dynammic storage for the best path, loading file with model probabilities.


Member Function Documentation

std::vector<int> freeling::vis_viterbi::find_best_path ( std::vector< double * > &  ) const

find_best_path: perform viterbi algorithm given the weights matrix

Referenced by freeling::bioner::analyze().

void freeling::vis_viterbi::softmax ( double *  p) const [private]

convert weights to probabilities


Member Data Documentation

N: number of classes.

std::vector<double> freeling::vis_viterbi::p_ini [private]

p_ini: vector with initial probabilities for each class

std::vector<std::vector<double> > freeling::vis_viterbi::p_trans [private]

p_trans: matrix with the probability transitions from one class to another e.g.

P(B,B), P(O,B), etc

whether to use softmax to convert given weights to probabilities

logprob for probability zero


The documentation for this class was generated from the following file: