Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 1.04 KB

README.md

File metadata and controls

40 lines (29 loc) · 1.04 KB

Travis build status Lifecycle: experimental

stanfordnlp

Stanford NLP in R.

Installation

# install.packages("remotes")
remotes::install_github("news-r/stanfordnlp")

Example

Reproduction of quick example

library(stanfordnlp)

download_model(lang = "en")
pipeline <- create_pipeline()
doc <- pipeline("Barack Obama was born in Hawaii. He was elected president in 2008.")
doc$sentences[[1]]$print_dependencies()
#> ('Barack', '4', 'nsubj:pass')
#> ('Obama', '1', 'flat')
#> ('was', '4', 'aux:pass')
#> ('born', '0', 'root')
#> ('in', '6', 'case')
#> ('Hawaii', '4', 'obl')
#> ('.', '4', 'punct')