Skip to content
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

How to modify to Chinese data set #45

Open
cuikai-ai opened this issue Dec 25, 2023 · 1 comment
Open

How to modify to Chinese data set #45

cuikai-ai opened this issue Dec 25, 2023 · 1 comment

Comments

@cuikai-ai
Copy link

Hello, because ontonotes contains Chinese dataset in addition to English dataset, but when I change to Chinese runtime it error the following message:
development: 0% 0/172 [00:00<?, ?docs/s]Exception in thread "main" java.lang.IllegalArgumentException: No head rule defined for DNP using class edu.stanford.nlp.trees.SemanticHeadFinder in DNP-27
at edu.stanford.nlp.trees.AbstractCollinsHeadFinder.determineNonTrivialHead(AbstractCollinsHeadFinder.java:222)
at edu.stanford.nlp.trees.SemanticHeadFinder.determineNonTrivialHead(SemanticHeadFinder.java:348)
at edu.stanford.nlp.trees.AbstractCollinsHeadFinder.determineHead(AbstractCollinsHeadFinder.java:179)
at edu.stanford.nlp.trees.TreeGraphNode.percolateHeads(TreeGraphNode.java:476)
at edu.stanford.nlp.trees.TreeGraphNode.percolateHeads(TreeGraphNode.java:474)
at edu.stanford.nlp.trees.TreeGraphNode.percolateHeads(TreeGraphNode.java:474)
at edu.stanford.nlp.trees.TreeGraphNode.percolateHeads(TreeGraphNode.java:474)
at edu.stanford.nlp.trees.GrammaticalStructure.(GrammaticalStructure.java:94)
at edu.stanford.nlp.trees.EnglishGrammaticalStructure.(EnglishGrammaticalStructure.java:86)
at edu.stanford.nlp.trees.EnglishGrammaticalStructure.(EnglishGrammaticalStructure.java:66)
at edu.stanford.nlp.parser.lexparser.EnglishTreebankParserParams.getGrammaticalStructure(EnglishTreebankParserParams.java:2271)
at edu.stanford.nlp.trees.GrammaticalStructure$TreeBankGrammaticalStructureWrapper$GsIterator.primeGs(GrammaticalStructure.java:1361)
at edu.stanford.nlp.trees.GrammaticalStructure$TreeBankGrammaticalStructureWrapper$GsIterator.next(GrammaticalStructure.java:1386)
at edu.stanford.nlp.trees.GrammaticalStructure$TreeBankGrammaticalStructureWrapper$GsIterator.next(GrammaticalStructure.java:1333)
at edu.stanford.nlp.trees.GrammaticalStructure.main(GrammaticalStructure.java:1604)
development: 0% 0/172 [00:00<?, ?docs/s]
Traceback (most recent call last):
File "F:\PycharmProject\wl-coref\convert_to_jsonlines.py", line 394, in
convert_con_to_dep(args.tmp_dir, conll_filenames)
File "F:\PycharmProject\wl-coref\convert_to_jsonlines.py", line 196, in convert_con_to_dep
subprocess.run(cmd, check=True, stdout=out)
File "F:\anaconda3\envs\spanbert\lib\subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['java', '-cp', 'downloads/stanford-parser.jar', 'edu.stanford.nlp.trees.EnglishGrammaticalStructure', '-basic', '-keepPunct', '-conllx', '-treeFile', 'temp\data/conll-2012/v4\data\development\data\chinese\annotations\bc\cctv\00\cctv_0000.v4_gold_conll']' returned non-zero exit status 1.

I think this may be because stanford-parser .jar does not contain support for Chinese grammar analysis, But I didn't find the relevant jar. So can you give me some suggestions or help with some changes?

@vdobrovolskii
Copy link
Owner

Hi
This might be relevant: #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants