SQL functions for conditional random field.
More...
|
float8 [] | lincrf_lbfgs_step_transition (float8[], float8[], float8[], float8[], float8, float8, float8[]) |
|
float8 [] | lincrf_lbfgs_step_merge_states (float8[] state1, float8[] state2) |
|
float8 [] | lincrf_lbfgs_step_final (float8[] state) |
|
float8 | internal_lincrf_lbfgs_converge (float8[] state) |
|
lincrf_result | internal_lincrf_lbfgs_result (float8[] state) |
|
aggregate float8 [] | lincrf_lbfgs_step (float8[], float8[], float8[], float8, float8, float8[]) |
|
aggregate anyarray | array_union (anyarray) |
|
integer | compute_lincrf (text source, text sparse_R, text dense_M, text sparse_M, text featureSize, integer tagSize, integer maxNumIterations) |
|
text | lincrf_train (text train_feature_tbl, text train_featureset_tbl, text label_tbl, text crf_stats_tbl, text crf_weights_tbl, integer max_iterations) |
| Compute linear-chain crf coefficients and diagnostic statistics. More...
|
|
text | lincrf_train (text train_feature_tbl, text train_featureset_tbl, text label_tbl, text crf_stats_tbl, text crf_weights_tbl) |
|
- Date
- July 2012
- See also
- For a brief introduction to conditional random field, see the module description Conditional Random Field.
◆ array_union()
aggregate anyarray array_union |
( |
anyarray |
| ) |
|
◆ compute_lincrf()
integer compute_lincrf |
( |
text |
source, |
|
|
text |
sparse_R, |
|
|
text |
dense_M, |
|
|
text |
sparse_M, |
|
|
text |
featureSize, |
|
|
integer |
tagSize, |
|
|
integer |
maxNumIterations |
|
) |
| |
◆ internal_lincrf_lbfgs_converge()
float8 internal_lincrf_lbfgs_converge |
( |
float8 [] |
state | ) |
|
◆ internal_lincrf_lbfgs_result()
lincrf_result internal_lincrf_lbfgs_result |
( |
float8 [] |
state | ) |
|
◆ lincrf_lbfgs_step()
aggregate float8 [] lincrf_lbfgs_step |
( |
float8 |
[], |
|
|
float8 |
[], |
|
|
float8 |
[], |
|
|
float8 |
, |
|
|
float8 |
, |
|
|
float8 |
[] |
|
) |
| |
◆ lincrf_lbfgs_step_final()
float8 [] lincrf_lbfgs_step_final |
( |
float8 [] |
state | ) |
|
◆ lincrf_lbfgs_step_merge_states()
float8 [] lincrf_lbfgs_step_merge_states |
( |
float8 [] |
state1, |
|
|
float8 [] |
state2 |
|
) |
| |
◆ lincrf_lbfgs_step_transition()
float8 [] lincrf_lbfgs_step_transition |
( |
float8 |
[], |
|
|
float8 |
[], |
|
|
float8 |
[], |
|
|
float8 |
[], |
|
|
float8 |
, |
|
|
float8 |
, |
|
|
float8 |
[] |
|
) |
| |
◆ lincrf_train() [1/2]
text lincrf_train |
( |
text |
train_feature_tbl, |
|
|
text |
train_featureset_tbl, |
|
|
text |
label_tbl, |
|
|
text |
crf_stats_tbl, |
|
|
text |
crf_weights_tbl, |
|
|
integer |
max_iterations |
|
) |
| |
- Parameters
-
source | Name of the source relation containing the training data |
sparse_R | Name of the sparse single state feature column (of type DOUBLE PRECISION[]) |
dense_M | Name of the dense two state feature column (of type DOUBLE PRECISION[]) |
sparse_M | Name of the sparse two state feature column (of type DOUBLE PRECISION[]) |
featureSize | Name of feature size column (of type DOUBLE PRECISION) |
tagSize | The number of tags in the tag set |
featureset | The unique feature set |
crf_feature | The Name of output feature table |
maxNumIterations | The maximum number of iterations |
- Returns
- a composite value:
coef FLOAT8[]
- Array of coefficients, \( \boldsymbol c \)
log_likelihood FLOAT8
- Log-likelihood \( l(\boldsymbol c) \)
num_iterations INTEGER
- The number of iterations before the algorithm terminated
A 'crf_feature' table is used to store all the features and corresponding weights
- Note
- This function starts an iterative algorithm. It is not an aggregate function. Source and column names have to be passed as strings (due to limitations of the SQL syntax).
◆ lincrf_train() [2/2]
text lincrf_train |
( |
text |
train_feature_tbl, |
|
|
text |
train_featureset_tbl, |
|
|
text |
label_tbl, |
|
|
text |
crf_stats_tbl, |
|
|
text |
crf_weights_tbl |
|
) |
| |