Special handling of "0:root" labels in deps column
See original GitHub issueI recently upgraded from conllu 1.3.1 to 2.2 due to the latter version’s ability to deal with elided tokens/copy nodes (e.g. token 8.1 below) which was addressed in https://github.com/EmilStenstrom/conllu/issues/27.
I am parsing the deps
column and have a loop which iterates over the deps
tuples to put the heads into a heads list and the relations into a relations list. The upgrade now includes the copy nodes which is good but now all 0:root
labels are returned as a string and not a tuple which breaks my loop.
# sent_id = weblog-blogspot.com_healingiraq_20040409053012_ENG_20040409_053012-0022
# text = Over 300 Iraqis are reported dead and 500 wounded in Fallujah alone.
1 Over over ADV RB _ 2 advmod 2:advmod _
2 300 300 NUM CD NumType=Card 3 nummod 3:nummod _
3 Iraqis Iraqis PROPN NNPS Number=Plur 5 nsubj:pass 5:nsubj:pass|6:nsubj:xsubj|8:nsubj:pass _
4 are be AUX VBP Mood=Ind|Tense=Pres|VerbForm=Fin 5 aux:pass 5:aux:pass _
5 reported report VERB VBN Tense=Past|VerbForm=Part|Voice=Pass 0 root 0:root _
6 dead dead ADJ JJ Degree=Pos 5 xcomp 5:xcomp _
7 and and CCONJ CC _ 8 cc 8:cc|8.1:cc _
8 500 500 NUM CD NumType=Card 5 conj 5:conj:and|8.1:nsubj:pass|9:nsubj:xsubj _
8.1 reported report VERB VBN Tense=Past|VerbForm=Part|Voice=Pass _ _ 5:conj:and CopyOf=5
9 wounded wounded ADJ JJ Degree=Pos 8 orphan 8.1:xcomp _
10 in in ADP IN _ 11 case 11:case _
11 Fallujah Fallujah PROPN NNP Number=Sing 5 obl 5:obl:in _
12 alone alone ADV RB _ 11 advmod 11:advmod SpaceAfter=No
13 . . PUNCT . _ 5 punct 5:punct _
I’m just wondering is this the desired behaviour? e.g. the output of deps looks like:
deps [[('advmod', 2)], [('nummod', 3)], [('nsubj:pass', 5), ('nsubj:xsubj', 6), ('nsubj:pass', 8)], [('aux:pass', 5)], '0:root', [('xcomp', 5)], [('cc', 8), ('cc', (8, '.', 1))], [('conj:and', 5), ('nsubj:pass', (8, '.', 1)), ('nsubj:xsubj', 9)], [('conj:and', 5)], [('xcomp', (8, '.', 1))], [('case', 11)], [('obl:in', 5)], [('advmod', 11)], [('punct', 5)]]
Is there any particular reason why '0:root'
shouldn’t be [('root', 0)]
?
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
lsblk(8) - Linux manual page - man7.org
In this case root permissions are necessary. The command prints all block devices (except RAM ... Use lsblk --help to get a list...
Read more >dvc.yaml Files | Data Version Control
If a stage command reads input files, these (or their directory locations) can be defined as dependenciesdependencies ( deps ). DVC will check...
Read more >BI Database Naming Standards: Contents
Many words such as DATE, GRANT, GROUP, OPTION, RESOURCE, and SET are special to the database and cannot be used alone as column...
Read more >dbt Guide - GitLab
This command will install or update the dependencies required for running dbt. To start a dbt container without the dependency update use make...
Read more >608-Disclosure - USPTO
Following the procedure for calculating fees for improper multiple dependent claims, a numeral "1" is placed in the "Dep." column with a circle...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Jbar-ry Thank you! I just released 2.2.1 with fixes this bug! Install it with
pip install -U conllu
.Thanks a lot @EmilStenstrom!