The below code executes successfully but it stops if it finds stats
dataframe has got 0 rows and its not executing and rbind the next set of rows that have more than 0 rows, so as to encounter that I have put a next
statement still it stops. Please help me out!
textrank<-NULL
for(i in lista){
if(i %in% dflist_T$VariaF){
Eachdesc <- subset(dflist_T, VariaF %in% i)
ud_model <- udpipe_load_model(model$file_model)
x <- udpipe_annotate(ud_model,x = Eachdesc$Description)
x <- as.data.frame(x)
stats <- keywords_rake(x = x,
term = "token", group = c("doc_id", "paragraph_id", "sentence_id"),
relevant = x$upos %in% c("NOUN", "ADJ"),
ngram_max = 4)
stats$Origin <- "dflist"
stats$lista <- i
if (nrow(stats) == 0) {
next}
textrank<-rbind(textrank,stats)
}
}