|
|
@ -50,19 +50,12 @@ actorizer <- function(out, localhost = F, ids, prefix, postfix, pre_tags, post_t
|
|
|
|
mutate(
|
|
|
|
mutate(
|
|
|
|
sentence_count = n()
|
|
|
|
sentence_count = n()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
hits <- as.data.table(ud)[as.data.table(markers), .(`_id`, lemma,x.start, start, end, x.end, sentence_id, merged), on =.(`_id` = `_id`, start <= marker_start, end >= marker_start)] %>%
|
|
|
|
hits <- left_join(ud, markers, by='_id') %>%
|
|
|
|
mutate(end = x.end,
|
|
|
|
mutate(
|
|
|
|
start = x.start) %>%
|
|
|
|
actor = case_when(
|
|
|
|
select(`_id`, sentence_id, start, end,merged) %>%
|
|
|
|
start <= marker_start & end >= marker_start ~ T,
|
|
|
|
|
|
|
|
T ~ F
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
) %>%
|
|
|
|
|
|
|
|
select(`_id`, sentence_id, start, end,actor,merged) %>%
|
|
|
|
|
|
|
|
filter(actor) %>%
|
|
|
|
|
|
|
|
group_by(`_id`,sentence_id) %>%
|
|
|
|
group_by(`_id`,sentence_id) %>%
|
|
|
|
summarise(
|
|
|
|
summarise(
|
|
|
|
actor = any(actor),
|
|
|
|
|
|
|
|
actor_start = I(list(start)),
|
|
|
|
actor_start = I(list(start)),
|
|
|
|
actor_end = I(list(end)),
|
|
|
|
actor_end = I(list(end)),
|
|
|
|
n_markers = length(start),
|
|
|
|
n_markers = length(start),
|
|
|
|