-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
56 lines (43 loc) · 1.36 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
output:
github_document:
html_preview: false
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- badges: start -->
[![Travis build status](https://travis-ci.org/news-r/stanfordnlp.svg?branch=master)](https://travis-ci.org/news-r/stanfordnlp)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
<!-- badges: end -->
# stanfordnlp
Stanford NLP in R.
## Installation
``` r
# install.packages("remotes")
remotes::install_github("news-r/stanfordnlp")
```
## Example
Reproduction of [quick example](https://stanfordnlp.github.io/stanfordnlp/installation_usage.html)
```{r, eval=FALSE}
library(stanfordnlp)
download_model(lang = "en")
pipeline <- create_pipeline()
doc <- pipeline("Barack Obama was born in Hawaii.")
doc$sentences[[1]]$print_dependencies()
```
```{r, echo=FALSE}
library(stanfordnlp)
reticulate::use_virtualenv("./env")
# Quick Example from site
# https://stanfordnlp.github.io/stanfordnlp/installation_usage.html
pipeline <- create_pipeline(models_dir = "model")
doc <- pipeline("Barack Obama was born in Hawaii.")
cat(reticulate::py_capture_output(doc$sentences[[1]]$print_dependencies()))
```