public final class ChainHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ChainHelper.ChainBPResults
Belief Propagation results.
|
static class |
ChainHelper.ChainCliqueValues
Clique scores within a chain.
|
static class |
ChainHelper.ChainViterbiResults
Viterbi output from a linear chain.
|
Modifier and Type | Method and Description |
---|---|
static ChainHelper.ChainBPResults |
beliefPropagation(ChainHelper.ChainCliqueValues scores)
Runs belief propagation on a linear chain CRF.
|
static double |
constrainedBeliefPropagation(ChainHelper.ChainCliqueValues scores,
int[] constraints)
Runs constrained belief propagation on a linear chain CRF.
|
static double |
sumLogProbs(DenseVector input)
Sums the log probabilities.
|
static double |
sumLogProbs(double[] input)
Sums the log probabilities.
|
static ChainHelper.ChainViterbiResults |
viterbi(ChainHelper.ChainCliqueValues scores)
Runs Viterbi on a linear chain CRF.
|
public static ChainHelper.ChainBPResults beliefPropagation(ChainHelper.ChainCliqueValues scores)
scores
- Tuple containing the label-label transition matrix, and the per token label scores.public static double constrainedBeliefPropagation(ChainHelper.ChainCliqueValues scores, int[] constraints)
See:
"Confidence Estimation for Information Extraction", A. Culotta and A. McCallum Proceedings of HLT-NAACL 2004: Short Papers, 2004.
scores
- Tuple containing the label-label transition matrix, and the per token label scores.constraints
- An array of integers, representing the label constraints. -1 signifies no constraint, otherwise it's the label id.public static ChainHelper.ChainViterbiResults viterbi(ChainHelper.ChainCliqueValues scores)
scores
- Tuple containing the label-label transition matrix, and the per token label scores.public static double sumLogProbs(DenseVector input)
sumLogProbs(double[])
.input
- A DenseVector
of log probabilities.public static double sumLogProbs(double[] input)
sumLogProbs(DenseVector)
.input
- A double array of log probabilities.Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.