| get_tp | R Documentation |
This function iterates over words in a given gold lexicon and accumulates the associative strength (can be integral e.g. 1, or real-valued) in the knowledge matrix for the intended referents (present in the gold lexicon). Returns the number of expected true positives (TP) for this gold lexicon and knowledge matrix.
get_tp(m, gold_lexicon)
m |
A matrix representing the knowledge matrix with words as rows and referents as columns. |
gold_lexicon |
A data frame or list where each row/element represents a word-object pair in the gold lexicon. |
A single value with the expected number of true positives.
dat <- xsl_datasets[[10]]
x <- xsl_run(baseline(), dat)
mat <- x$fits[[1]]$matrix
lex <- list(words = rep(1:18), objects = rep(1:18))
get_tp(mat, lex)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.