トップ 差分 一覧 Farm ソース 検索 ヘルプ PDF RSS ログイン

udpipe

*disclaimer
189118

R

udpipe


https://bnosac.github.io/udpipe/en/


Universal Dependencies
https://universaldependencies.org/#ud-treebanks

 特徴

  • PythonやJavaなしで、Rのみで実行可能


 インストール

```{r, eval=F}
install.packages("udpipe")
```

```{r}
library(udpipe)

library(dplyr)
library(ggplot2)
library(stringr)
```


 使用例

library(ggraph)
library(ggplot2)
library(igraph)
library(textplot)

bun <- udpipe("What kind of sports do you like?", "english")
bun

	doc_id	paragraph_id	sentence_id	sentence	start	end	term_id	token_id	token	lemma	upos	xpos	feats	head_token_id	dep_rel	deps	misc
1	doc1	1	1	What kind of sports do you like?	1	4	1	1	What	what	DET	WDT	PronType=Int	2	det	NA	NA
2	doc1	1	1	What kind of sports do you like?	6	9	2	2	kind	kind	NOUN	NN	Number=Sing	7	obj	NA	NA
3	doc1	1	1	What kind of sports do you like?	11	12	3	3	of	of	ADP	IN	NA	4	case	NA	NA
4	doc1	1	1	What kind of sports do you like?	14	19	4	4	sports	sport	NOUN	NNS	Number=Plur	2	nmod	NA	NA
5	doc1	1	1	What kind of sports do you like?	21	22	5	5	do	do	AUX	VBP	Mood=Ind|Tense=Pres|VerbForm=Fin	7	aux	NA	NA
6	doc1	1	1	What kind of sports do you like?	24	26	6	6	you	you	PRON	PRP	Case=Nom|Person=2|PronType=Prs	7	nsubj	NA	NA
7	doc1	1	1	What kind of sports do you like?	28	31	7	7	like	like	VERB	VB	VerbForm=Inf	0	root	NA	SpaceAfter=No
8	doc1	1	1	What kind of sports do you like?	32	32	8	8	?	?	PUNCT	.	NA	7	punct	NA	SpacesAfter=\n


textplot_dependencyparser(bun)