From 4407a9977407508edc80da19b0d8672fda32fd84 Mon Sep 17 00:00:00 2001 From: Erik de Vries Date: Mon, 14 Jan 2019 17:25:45 +0100 Subject: [PATCH] actorizer: fix to get actual number of sentence occurences of actor --- R/actorizer.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/actorizer.R b/R/actorizer.R index dbdfc0b..9ea4b13 100644 --- a/R/actorizer.R +++ b/R/actorizer.R @@ -38,7 +38,7 @@ actorizer <- function(out, localhost = F, ids, type, prefix, postfix, identifier token_id = list(list(as.integer(token_id))), text = list(list(unique(as.character(sentence)))) ) - occurences <- length(unique(ud$sentence_id)) # Number of sentences in which actor occurs + occurences <- length(unique(ud$sentence_id[[1]][[1]])) # Number of sentences in which actor occurs prominence <- occurences/sentence_count # Relative prominence of actor in article (number of occurences/total # sentences) rel_first <- 1-(ud$sentence_id[[1]][[1]][1]/sentence_count) # Relative position of first occurence at sentence level