fjmurguzur / causalizeR

A simple R algorithm to extract causal linkages between words in unstructured texts
5 stars 3 forks source link

An error when using column of a data frame in causalize function #1

Open zl19990820 opened 1 year ago

zl19990820 commented 1 year ago

Hey , thanks for your awesome work. Here i get an error when i run your example(you supplied in your paper published in PeerJ,2021), i run the code step by step and after i run: for(i in 1:length(effects$effect)){ temp.list[[i]]<-causalize(bib_df$AB,effect=effects[i,1],effect_num=effects[i,2], tokenizer = udpipe_load_model(file = "english-ewt-ud-2.5-191206.udpipe")) } i get an error information as follows: Error in if (which(sent1$lemma == effect) == 1) { : the condition has length > 1

fjmurguzur commented 11 months ago

Hi, I apologize for the late reply. This error is due to the "effect" appearing twice in the same sentence. This did not happen when I created the function, and I will get this solved as soon as possible. Thanks for finding the bug!