Computes the unnormalized log conditional distribution over values of the
element at position pos in the sequence, conditioned on the values of the
elements in all other positions of the provided sequence.

getPossibleValues

Return the valid sequence labels (as integer indices) for a particular
position in the sequence. Since the sequence is padded at each end,
typically sequence items 0...leftWindow-1 are null,
leftWindow...length+leftWindow-1 are words,
length+leftWindow...length+leftWindow+rightWindow-1 are null.

scoreOf

Computes the score of the element at the given position in the sequence,
conditioned on the values of the elements in all other positions of the
provided sequence. Typically, this is an unnormalized log conditional
probability of the label at the given position in the sequence, given the
input data nd the other labels.

sequence - The sequence containing the prediction and the rest of the
labels to condition on

pos - The position of the element to give a score for

Returns:

The score of the label at the specified position in the sequence

scoresOf

public double[] scoresOf(int[] sequence,
int position)

Computes the unnormalized log conditional distribution over values of the
element at position pos in the sequence, conditioned on the values of the
elements in all other positions of the provided sequence.

sequence - the sequence containing the rest of the values to condition on

position - the position of the element to give a distribution for

Returns:

an array of type double, representing a probability distribution;
sums to 1.0

scoreOf

public double scoreOf(int[] sequence)

Returns the log probability of this sequence given the CRF. Does so by
computing the marginal of the first windowSize tags, and then computing the
conditional probability for the rest of them, conditioned on the previous
tags.

logProbsToDoubleArr

probs

logProbs

logProb

public double logProb(int position,
int[] labels)

returns the log probability for the given labels (indexed using
classIndex), where the last label corresponds to the label at the specified
position. For instance if you called logProb(5, {1,2,3}) it will return the
marginal log prob that the label at position 3 is 1, the label at position
4 is 2 and the label at position 5 is 3.

prob

public double prob(int position,
int[] labels)

Returns the probability for the given labels (indexed using classIndex),
where the last label corresponds to the label at the specified position.
For instance if you called prob(5, {1,2,3}) it will return the marginal
prob that the label at position 3 is 1, the label at position 4 is 2 and
the label at position 5 is 3.

logProb

returns the log probability for the given labels, where the last label
corresponds to the label at the specified position. For instance if you
called logProb(5, {"O", "PER", "ORG"}) it will return the marginal log prob
that the label at position 3 is "O", the label at position 4 is "PER" and
the label at position 5 is "ORG".

prob

returns the probability for the given labels, where the last label
corresponds to the label at the specified position. For instance if you
called logProb(5, {"O", "PER", "ORG"}) it will return the marginal prob
that the label at position 3 is "O", the label at position 4 is "PER" and
the label at position 5 is "ORG".