Skip to content

Instantly share code, notes, and snippets.

@eob
Created November 24, 2010 18:28
Show Gist options
  • Save eob/714148 to your computer and use it in GitHub Desktop.
Save eob/714148 to your computer and use it in GitHub Desktop.
def initializeToCrfPotentials = {
for (tweetIdx <- 0 until _Y.size) {
for (tokenIdx <- 0 until _Y(tweetIdx).size) {
for (labelIdx <- 0 until _Y(tweetIdx)(tokenIdx).size) {
// Note: the +1 in token index is because of the <S> token at the beginning
// of the CRF potentials.
logger.info(tweetIdx + " " + tokenIdx + " " + labelIdx)
_Y(tweetIdx)(tokenIdx)(labelIdx) = _crfPotentials(tweetIdx)(tokenIdx + 1)(labelIdx)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment