bnosac / udpipe

R package for Tokenization, Parts of Speech Tagging, Lemmatization and Dependency Parsing Based on the UDPipe Natural Language Processing Toolkit
https://bnosac.github.io/udpipe/en
Mozilla Public License 2.0
209 stars 33 forks source link

as.data.frame error #16

Closed passarom closed 6 years ago

passarom commented 6 years ago

May you please help me with this problem?

After running

library(udpipe) udmodel <- udpipe_download_model(language = "dutch") udmodel <- udpipe_load_model(file = udmodel$file_model) x <- udpipe_annotate(udmodel, x = "Ik ging op reis en ik nam mee: mijn laptop, mijn zonnebril en goed humeur.") x <- as.data.frame(x)

I have the following error:

Error in data.table::setDF(out) : setDF only accepts data.table, data.frame or list of equal length as input

"x" looks like in the following:

$x [1] "Ik ging op reis en ik nam mee: mijn laptop, mijn zonnebril en goed humeur."

$conllu [1] "# newdoc id = doc1\n# newpar\n# sentid = 1\n# text = Ik ging op reis en ik nam mee: mijn laptop, mijn zonnebril en goed humeur.\n1\tIk\tik\tPRON\tPron|per|1|ev|nom\tCase=Nom|Number=Sing|Person=1|PronType=Prs\t2\tnsubj\t\t\n2\tging\tga\tVERB\tV|intrans|ovt|1of2of3|ev\tAspect=Imp|Mood=Ind|Number=Sing|Subcat=Intr|Tense=Past|VerbForm=Fin\t0\troot\t\t\n3\top\top\tADP\tPrep|voor\tAdpType=Prep\t4\tcase\t\t\n4\treis\treis\tNOUN\tN|soort|ev|neut\tNumber=Sing\t2\tobj\t\t\n5\ten\ten\tCCONJ\tConj|neven\t\t7\tcc\t\t\n6\tik\tik\tPRON\tPron|per|1|ev|nom\tCase=Nom|Number=Sing|Person=1|PronType=Prs\t7\tnsubj\t\t\n7\tnam\tneem\tVERB\tV|trans|ovt|1of2of3|ev\tAspect=Imp|Mood=Ind|Number=Sing|Subcat=Tran|Tense=Past|VerbForm=Fin\t2\tconj\t\t\n8\tmee\tmee\tADV\tAdv|deelv\tPartType=Vbp\t7\tcompound:prt\t\tSpaceAfter=No\n9\t:\t:\tPUNCT\tPunc|dubbpunt\tPunctType=Colo\t2\tpunct\t\t\n10\tmijn\tmijn\tPRON\tPron|bez|1|ev|neut|attr\tNumber=Sing|Person=1|Poss=Yes|PronType=Prs\t11\tnmod\t\t\n11\tlaptop\tlaptop\tNOUN\tN|soort|ev|neut\tNumber=Sing\t2\tnsubj\t\tSpaceAfter=No\n12\t,\t,\tPUNCT\tPunc|komma\tPunctType=Comm\t11\tpunct\t\t\n13\tmijn\tmijn\tPRON\tPron|bez|1|ev|neut|attr\tNumber=Sing|Person=1|Poss=Yes|PronType=Prs\t14\tnmod\t\t\n14\tzonnebril\tzonnebril\tNOUN\tN|soort|ev|neut\tNumber=Sing\t11\tappos\t\t\n15\ten\teen\tCCONJ\tConj|neven\t\t17\tcc\t\t\n16\tgoed\tgoed\tADJ\tAdj|attr|stell|onverv\tDegree=Pos\t17\tamod\t\t\n17\thumeur\thumeur\tNOUN\tN|soort|ev|neut\tNumber=Sing\t14\tconj\t\tSpaceAfter=No\n18\t.\t.\tPUNCT\tPunc|punt\tPunctType=Peri\t2\tpunct\t_\tSpacesAfter=\n\n\n"

$errors [1] ""

attr(,"class") [1] "udpipe_connlu"

Thank you. Best,

Marco

jwijffels commented 6 years ago

Marco, Can you tell me which version of data.table you are using? As in installed.packages()["data.table", ]

passarom commented 6 years ago

I am running the version 1.9.6 of data.table under R version 3.4.3.

jwijffels commented 6 years ago

Can you update the data.table package and retry? install.packages("data.table")

passarom commented 6 years ago

It works. Thank you

jwijffels commented 6 years ago

I fixed the issue in commit a0c829e0bed39a0c6395c8671d41f4ac78661e4a so that you can still keep using data.table 1.9.6 instead of expecting a higher version of the data.table package. This fixed the issue that you encountered. Feel free to open a new issue if you encounter other things.