FreeLing  3.0
Public Member Functions | Private Member Functions | Private Attributes
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 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< int > find_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

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> vis_viterbi::find_best_path ( std::vector< double * > &  ) const

find_best_path: perform viterbi algorithm given the weights matrix

Referenced by bioner::analyze().

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

convert weights to probabilities


Member Data Documentation

int vis_viterbi::N [private]

N: number of classes.

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

p_ini: vector with initial probabilities for each class

std::vector<std::vector<double> > 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

double vis_viterbi::ZERO_logprob [private]

logprob for probability zero


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