You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
call_frog and do_call_frog hang indefinetely for me. then again, manually approaching the port via the command
telnet localhost 9972
works.
When fiddeling a bit, I found that a slight adjustment of the do_call_frog function helped me out:
I removed the dollar sign at ready and can programmatically use frog via this function, but not with call_frog.
do_call_frog
function(socket, text) {
write.socket(socket, text)
write.socket(socket, "\nEOT\n")
# read until 'READY' is found
output <- ""
while (!grepl("\nREADY\n", output)) {
output = paste(output, read.socket(socket), sep="")
}
output = gsub("READY\n", "", output)
# read output and label columns
con <- textConnection(output)
result = read.csv(con, sep='\t', quote = '', header=F)
close(con)
colnames(result) <- c("position", "word", "lemma", "morph", "pos", "prob",
"ner", "chunk", "parse1", "parse2")
result$majorpos = gsub("\\(.*", "", result$pos)
# assign sentence number by assigning number when position == 1 and filling down into NA cells using zoo::na.locf
result$sent[result$position == 1] = 1:sum(result$position == 1)
if(is.na(result$sent[1])) result$sent[1] = 1
result$sent = na.locf(result$sent)
result
}
it works for me using:
lapply(c("dit is een toets", "waarom heeft hij geen zin meer?"), FUN = do_call_frog, socket=make.socket(port = 9972)) %>% data.table::rbindlist()
Why is that? a few month ago I had no problems using frogr. not sure if I used it with the container though.
The text was updated successfully, but these errors were encountered:
Hey! I used docker run -p 8080:80 -t -i proycon/lamachine to start the docker. In R in use call_frog(tekst, host="localhost", port=8080) to call frog. Does this work for you, @KnutJaegersberg ?
Hi,
using the recent docker image, via
sudo docker run -p 9972:9972 -t -i proycon/lamachine
frog -S 9972
call_frog and do_call_frog hang indefinetely for me. then again, manually approaching the port via the command
telnet localhost 9972
works.
When fiddeling a bit, I found that a slight adjustment of the do_call_frog function helped me out:
I removed the dollar sign at ready and can programmatically use frog via this function, but not with call_frog.
}
it works for me using:
lapply(c("dit is een toets", "waarom heeft hij geen zin meer?"), FUN = do_call_frog, socket=make.socket(port = 9972)) %>% data.table::rbindlist()
Why is that? a few month ago I had no problems using frogr. not sure if I used it with the container though.
The text was updated successfully, but these errors were encountered: