2.1.0
User Documentation for Apache MADlib
viterbi.sql_in File Reference

concatenate a set of input values into arrays to feed into viterbi c function and create a human readable view of the output More...

Functions

text vcrf_top1_table (text segment_tbl, text label_tbl, text resulttbl_raw, text result_tbl)
 This function creates the specified result_tbl containing top1 labels for the sequence. More...
 
int [] vcrf_top1_label (float8[] marray, float8[] rarray, int nlabel)
 This function implements the Viterbi algorithm which takes the sentence to be label as input and return the top1 labeling for that sentence. More...
 
text vcrf_label (text segment_tbl, text factor_mtbl, text factor_rtbl, text label_tbl, text result_tbl)
 This function prepares the inputs for the c function 'vcrf_top1_label' and invoke the c function. More...
 

Detailed Description

Date
February 2012

Function Documentation

◆ vcrf_label()

text vcrf_label ( text  segment_tbl,
text  factor_mtbl,
text  factor_rtbl,
text  label_tbl,
text  result_tbl 
)
Parameters
segment_tblName of table containing all the testing sentences.
factor_mtblName of table containing all the m factors.
factor_rtblName of table containing all the r factors.
label_tblName of table containing all the labels in the label space.
result_tblName of table to store the output
Returns
the top1 label sequence, the last two elements in the array is used to calculate the top1 probability

◆ vcrf_top1_label()

int [] vcrf_top1_label ( float8 []  marray,
float8 []  rarray,
int  nlabel 
)
Parameters
marrayName of arrays containing m factors
rarrayName of arrays containing r factors
nlabelTotal number of labels in the label space
Returns
the top1 label sequence, the last two elements in the array is used to calculate the top1 probability

◆ vcrf_top1_table()

text vcrf_top1_table ( text  segment_tbl,
text  label_tbl,
text  resulttbl_raw,
text  result_tbl 
)
Parameters
segment_tblName of table containing all the testing sentences.
label_tblName of table containing all the labels in the label space.
result_tblName of table storing the best label sequence and the conditional probability.