Search code examples
machine-learningnlpstanford-nlpopennlp

How to do dependency parsing in R language?


I did POSTagging. But how to do dependency parsing? Can I get the code for it in R language ?


Solution

  • Probably you already figured out. if not, how I did dependency parsing in R:

    library(cleanNLP)
    library(udpipe)
    
    s <- "I prefer the morning flight through Denver"
    
    cnlp_init_udpipe()
    doc <- cnlp_annotate(s, as_strings = TRUE)
    cnlp_get_dependency(doc, get_token = FALSE)