-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError #5
Comments
Could you share the first few couple of lines from your input file? |
Sure! Here is what the first few lines of my conllu file looks like: 1 # # X XX _ 2 dep _ _
4 The the DET DT _ 6 det _ _ |
I don’t know if GitHub messed with the formatting, but it seems like the third token is a newline character? The |
That makes sense, thanks! And my PhD advisor wrote a python program to convert txt files to conllu format; happy to add the code if you're interested in looking at it :) |
I've been attempting to run analyses from the textcomplexity library but keep getting the following error:
TypeError: UdToken.__new__() missing 9 required positional arguments: 'form', 'lemma', 'upos', 'xpos', 'feats', 'head', 'deprel', 'deps', and 'misc'
Here's a deeper look at what's happening:
!txtcomplexity -i conllu 'output.conllu'
Traceback (most recent call last):
File "/usr/local/bin/txtcomplexity", line 12, in textcomplexity.cli.main()
File "/usr/local/lib/python3.10/dist-packages/textcomplexity/cli.py", line 194, in main sentences, graphs = zip(*conllu.read_conllu_sentences(f, ignore_case=args.ignore_case))
File "/usr/local/lib/python3.10/dist-packages/textcomplexity/utils/conllu.py", line 16, in read_conllu_sentences for sentence, sent_id in _read_conllu(f, ignore_case):
File "/usr/local/lib/python3.10/dist-packages/textcomplexity/utils/conllu.py", line 66, in _read_conllu sentence.append(UdToken(*fields))
TypeError: UdToken.__new__() missing 9 required positional arguments: 'form', 'lemma', 'upos', 'xpos', 'feats', 'head', 'deprel', 'deps', and 'misc'
Is this related to an error in my conllu file or how I'm using the textcomplexity library? Any help would be much appreciated! :)
The text was updated successfully, but these errors were encountered: