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

common.AMRGraph.ParserError: Unexpected token :op2 #27

Open
OPilgrim opened this issue Jan 16, 2023 · 0 comments
Open

common.AMRGraph.ParserError: Unexpected token :op2 #27

OPilgrim opened this issue Jan 16, 2023 · 0 comments

Comments

@OPilgrim
Copy link

When I was running the command python amr_parsing.py -m preprocess --amrfmt amr ./tmp.txt.all.basic-abt-brown-verb.parsed, something went wrong. What happened?

This is the content in tmp.txt.all.basic-abt-brown-verb.parsed file:

# ::id 1
# ::snt Whenever a reporter adverted to the new Nixon, the candidate bridled; he remembered that as an accusation of trickiness in previous campaigns and resented the question.
(x / xconcept
	:x (x13 / and
		:op15 (x1 / whenever)
		:op2 (x12 / bridle
			:concession (x4 / advert
				:ARG0 (x3 / person
					:ARG0-of (r / report-01))
				:ARG2 (x8 / person
					:name (n / name
						:op1 "Nixon")
					:mod (x7 / new)))
			:ARG0 (x11 / candidate)
			:ARG1 (x25 / and
				:op1 (x15 / remember-01
					:ARG0 (x14 / he)
					:ARG1 (x19 / accusation
						:beneficiary (x24 / campaign-01
							:time (x23 / previous))))
				:op2 (x26 / resent
					:ARG0 x14
					:ARG1 (x28 / question-01))))))

# ::id 2
# ::snt 30 For many in Capistrano, no welcome for swallows 22 REGIONAL/32-40 The oldest clinic in New York City, the Northern Dispensary at 165 Waverly Place, will close in May and become a nursing home for AIDS patients.
(x34 / and
	:op1 (x31 / close-01
		:null_edge (x23 / null_tag
			:null_edge (x8 / welcome-01
				:null_edge 30
				:polarity -
				:ARG1 regional/32
					:null_edge 22)
				:ARG1 (x16 / clinic
					:domain (x10 / swallow-01)
					:mod (x15 / old
						:degree (m / most))
					:location (x20 / city
						:null_edge (x18 / null_tag)
						:null_edge (x19 / country
							:name (n3 / name
								:op1 "York")))))
			:location (x28 / country
				:name (n / name
					:op1 "Place")
				:null_edge (x26 / 165)
				:null_edge (x27 / country
					:name (n1 / name
						:op1 "Waverly"))))
		:time (x33 / date-entity))
	:op2 (x35 / become-01
		:ARG2 (x38 / home
			:purpose (x37 / nursing)
			:location-of (x41 / patient
				:mod (x40 / disease
					:name (n2 / name
						:op1 "AIDS"))))))

This is the result of the script and the error message:

Writing sentence file to ./tmp.txt.all.basic-abt-brown-verb.parsed.sent
Start Stanford CoreNLP...
java -Xmx2500m -cp stanfordnlp/stanford-corenlp-full-2015-04-20/stanford-corenlp-3.5.2.jar:stanfordnlp/stanford-corenlp-full-2015-04-20/stanford-corenlp-3.5.2-models.jar:stanfordnlp/stanford-corenlp-full-2015-04-20/joda-time.jar:stanfordnlp/stanford-corenlp-full-2015-04-20/xom.jar:stanfordnlp/stanford-corenlp-full-2015-04-20/jollyday.jar:stanfordnlp/stanford-corenlp-full-2015-04-20/protobuf.jar:stanfordnlp/stanford-corenlp-full-2015-04-20/javax.json.jar:stanfordnlp/stanford-corenlp-full-2015-04-20/ejml-0.23.jar edu.stanford.nlp.pipeline.StanfordCoreNLP -props stanfordnlp/default.properties
Loading Models: 4/4                                                                                                                
Read token,lemma,name entity file ./tmp.txt.all.basic-abt-brown-verb.parsed.sent.prp...
========================================
'Whenever a reporter adverted to the new Nixon, the candidate bridled; he remembered that as an accusation of trickiness in previous campaigns and resented the question.\r\n\r\nSentence #1 (29 tokens):\r\nWhenever a reporter adverted to the new Nixon, the candidate bridled; he remembered that as an accusation of trickiness in previous campaigns and resented the question.\r\n[Text=Whenever CharacterOffsetBegin=0 CharacterOffsetEnd=8 PartOfSpeech=NNP Lemma=Whenever NamedEntityTag=O]\r\n[Text=a CharacterOffsetBegin=9 CharacterOffsetEnd=10 PartOfSpeech=DT Lemma=a NamedEntityTag=O]\r\n[Text=reporter CharacterOffsetBegin=11 CharacterOffsetEnd=19 PartOfSpeech=NN Lemma=reporter NamedEntityTag=O]\r\n[Text=adverted CharacterOffsetBegin=20 CharacterOffsetEnd=28 PartOfSpeech=VBN Lemma=advert NamedEntityTag=O]\r\n[Text=to CharacterOffsetBegin=29 CharacterOffsetEnd=31 PartOfSpeech=TO Lemma=to NamedEntityTag=O]\r\n[Text=the CharacterOffsetBegin=32 CharacterOffsetEnd=35 PartOfSpeech=DT Lemma=the NamedEntityTag=O]\r\n[Text=new CharacterOffsetBegin=36 CharacterOffsetEnd=39 PartOfSpeech=JJ Lemma=new NamedEntityTag=O]\r\n[Text=Nixon CharacterOffsetBegin=40 CharacterOffsetEnd=45 PartOfSpeech=NNP Lemma=Nixon NamedEntityTag=PERSON]\r\n[Text=, CharacterOffsetBegin=45 CharacterOffsetEnd=46 PartOfSpeech=, Lemma=, NamedEntityTag=O]\r\n[Text=the CharacterOffsetBegin=47 CharacterOffsetEnd=50 PartOfSpeech=DT Lemma=the NamedEntityTag=O]\r\n[Text=candidate CharacterOffsetBegin=51 CharacterOffsetEnd=60 PartOfSpeech=NN Lemma=candidate NamedEntityTag=O]\r\n[Text=bridled CharacterOffsetBegin=61 CharacterOffsetEnd=68 PartOfSpeech=VBD Lemma=bridle NamedEntityTag=O]\r\n[Text=; CharacterOffsetBegin=68 CharacterOffsetEnd=69 PartOfSpeech=: Lemma=; NamedEntityTag=O]\r\n[Text=he CharacterOffsetBegin=70 CharacterOffsetEnd=72 PartOfSpeech=PRP Lemma=he NamedEntityTag=O]\r\n[Text=remembered CharacterOffsetBegin=73 CharacterOffsetEnd=83 PartOfSpeech=VBD Lemma=remember NamedEntityTag=O]\r\n[Text=that CharacterOffsetBegin=84 CharacterOffsetEnd=88 PartOfSpeech=IN Lemma=that NamedEntityTag=O]\r\n[Text=as CharacterOffsetBegin=89 CharacterOffsetEnd=91 PartOfSpeech=IN Lemma=as NamedEntityTag=O]\r\n[Text=an CharacterOffsetBegin=92 CharacterOffsetEnd=94 PartOfSpeech=DT Lemma=a NamedEntityTag=O]\r\n[Text=accusation CharacterOffsetBegin=95 CharacterOffsetEnd=105 PartOfSpeech=NN Lemma=accusation NamedEntityTag=O]\r\n[Text=of CharacterOffsetBegin=106 CharacterOffsetEnd=108 PartOfSpeech=IN Lemma=of NamedEntityTag=O]\r\n[Text=trickiness CharacterOffsetBegin=109 CharacterOffsetEnd=119 PartOfSpeech=NN Lemma=trickiness NamedEntityTag=O]\r\n[Text=in CharacterOffsetBegin=120 CharacterOffsetEnd=122 PartOfSpeech=IN Lemma=in NamedEntityTag=O]\r\n[Text=previous CharacterOffsetBegin=123 CharacterOffsetEnd=131 PartOfSpeech=JJ Lemma=previous NamedEntityTag=O]\r\n[Text=campaigns CharacterOffsetBegin=132 CharacterOffsetEnd=141 PartOfSpeech=NNS Lemma=campaign NamedEntityTag=O]\r\n[Text=and CharacterOffsetBegin=142 CharacterOffsetEnd=145 PartOfSpeech=CC Lemma=and NamedEntityTag=O]\r\n[Text=resented CharacterOffsetBegin=146 CharacterOffsetEnd=154 PartOfSpeech=VBD Lemma=resent NamedEntityTag=O]\r\n[Text=the CharacterOffsetBegin=155 CharacterOffsetEnd=158 PartOfSpeech=DT Lemma=the NamedEntityTag=O]\r\n[Text=question CharacterOffsetBegin=159 CharacterOffsetEnd=167 PartOfSpeech=NN Lemma=question NamedEntityTag=O]\r\n[Text=. CharacterOffsetBegin=167 CharacterOffsetEnd=168 PartOfSpeech=. Lemma=. NamedEntityTag=O]\r\nNLP> '
========================================
'30 For many in Capistrano, no welcome for swallows 22 REGIONAL/32-40 The oldest clinic in New York City, the Northern Dispensary at 165 Waverly Place, will close in May and become a nursing home for AIDS patients.\r\n\r\nSentence #1 (42 tokens):\r\n30 For many in Capistrano, no welcome for swallows 22 REGIONAL/32-40 The oldest clinic in New York City, the Northern Dispensary at 165 Waverly Place, will close in May and become a nursing home for AIDS patients.\r\n[Text=30 CharacterOffsetBegin=0 CharacterOffsetEnd=2 PartOfSpeech=CD Lemma=30 NamedEntityTag=NUMBER NormalizedNamedEntityTag=30.0]\r\n[Text=For CharacterOffsetBegin=3 CharacterOffsetEnd=6 PartOfSpeech=IN Lemma=for NamedEntityTag=O]\r\n[Text=many CharacterOffsetBegin=7 CharacterOffsetEnd=11 PartOfSpeech=JJ Lemma=many NamedEntityTag=O]\r\n[Text=in CharacterOffsetBegin=12 CharacterOffsetEnd=14 PartOfSpeech=IN Lemma=in NamedEntityTag=O]\r\n[Text=Capistrano CharacterOffsetBegin=15 CharacterOffsetEnd=25 PartOfSpeech=NNP Lemma=Capistrano NamedEntityTag=LOCATION]\r\n[Text=, CharacterOffsetBegin=25 CharacterOffsetEnd=26 PartOfSpeech=, Lemma=, NamedEntityTag=O]\r\n[Text=no CharacterOffsetBegin=27 CharacterOffsetEnd=29 PartOfSpeech=DT Lemma=no NamedEntityTag=O]\r\n[Text=welcome CharacterOffsetBegin=30 CharacterOffsetEnd=37 PartOfSpeech=JJ Lemma=welcome NamedEntityTag=O]\r\n[Text=for CharacterOffsetBegin=38 CharacterOffsetEnd=41 PartOfSpeech=IN Lemma=for NamedEntityTag=O]\r\n[Text=swallows CharacterOffsetBegin=42 CharacterOffsetEnd=50 PartOfSpeech=NNS Lemma=swallow NamedEntityTag=O]\r\n[Text=22 CharacterOffsetBegin=51 CharacterOffsetEnd=53 PartOfSpeech=CD Lemma=22 NamedEntityTag=NUMBER NormalizedNamedEntityTag=22.0]\r\n[Text=REGIONAL/32 CharacterOffsetBegin=54 CharacterOffsetEnd=65 PartOfSpeech=NN Lemma=regional/32 NamedEntityTag=O]\r\n[Text=-40 CharacterOffsetBegin=65 CharacterOffsetEnd=68 PartOfSpeech=CD Lemma=-40 NamedEntityTag=NUMBER NormalizedNamedEntityTag=-40.0]\r\n[Text=The CharacterOffsetBegin=69 CharacterOffsetEnd=72 PartOfSpeech=DT Lemma=the NamedEntityTag=O]\r\n[Text=oldest CharacterOffsetBegin=73 CharacterOffsetEnd=79 PartOfSpeech=JJS Lemma=oldest NamedEntityTag=O]\r\n[Text=clinic CharacterOffsetBegin=80 CharacterOffsetEnd=86 PartOfSpeech=NN Lemma=clinic NamedEntityTag=O]\r\n[Text=in CharacterOffsetBegin=87 CharacterOffsetEnd=89 PartOfSpeech=IN Lemma=in NamedEntityTag=O]\r\n[Text=New CharacterOffsetBegin=90 CharacterOffsetEnd=93 PartOfSpeech=NNP Lemma=New NamedEntityTag=LOCATION]\r\n[Text=York CharacterOffsetBegin=94 CharacterOffsetEnd=98 PartOfSpeech=NNP Lemma=York NamedEntityTag=LOCATION]\r\n[Text=City CharacterOffsetBegin=99 CharacterOffsetEnd=103 PartOfSpeech=NNP Lemma=City NamedEntityTag=LOCATION]\r\n[Text=, CharacterOffsetBegin=103 CharacterOffsetEnd=104 PartOfSpeech=, Lemma=, NamedEntityTag=O]\r\n[Text=the CharacterOffsetBegin=105 CharacterOffsetEnd=108 PartOfSpeech=DT Lemma=the NamedEntityTag=O]\r\n[Text=Northern CharacterOffsetBegin=109 CharacterOffsetEnd=117 PartOfSpeech=NNP Lemma=Northern NamedEntityTag=O]\r\n[Text=Dispensary CharacterOffsetBegin=118 CharacterOffsetEnd=128 PartOfSpeech=NNP Lemma=Dispensary NamedEntityTag=O]\r\n[Text=at CharacterOffsetBegin=129 CharacterOffsetEnd=131 PartOfSpeech=IN Lemma=at NamedEntityTag=O]\r\n[Text=165 CharacterOffsetBegin=132 CharacterOffsetEnd=135 PartOfSpeech=CD Lemma=165 NamedEntityTag=NUMBER NormalizedNamedEntityTag=165.0]\r\n[Text=Waverly CharacterOffsetBegin=136 CharacterOffsetEnd=143 PartOfSpeech=NNP Lemma=Waverly NamedEntityTag=LOCATION]\r\n[Text=Place CharacterOffsetBegin=144 CharacterOffsetEnd=149 PartOfSpeech=NNP Lemma=Place NamedEntityTag=LOCATION]\r\n[Text=, CharacterOffsetBegin=149 CharacterOffsetEnd=150 PartOfSpeech=, Lemma=, NamedEntityTag=O]\r\n[Text=will CharacterOffsetBegin=151 CharacterOffsetEnd=155 PartOfSpeech=MD Lemma=will NamedEntityTag=O]\r\n[Text=close CharacterOffsetBegin=156 CharacterOffsetEnd=161 PartOfSpeech=VB Lemma=close NamedEntityTag=O]\r\n[Text=in CharacterOffsetBegin=162 CharacterOffsetEnd=164 PartOfSpeech=IN Lemma=in NamedEntityTag=O]\r\n[Text=May CharacterOffsetBegin=165 CharacterOffsetEnd=168 PartOfSpeech=NNP Lemma=May NamedEntityTag=DATE NormalizedNamedEntityTag=XXXX-05 Timex=<TIMEX3 tid="t1" type="DATE" value="XXXX-05">May</TIMEX3>]\r\n[Text=and CharacterOffsetBegin=169 CharacterOffsetEnd=172 PartOfSpeech=CC Lemma=and NamedEntityTag=O]\r\n[Text=become CharacterOffsetBegin=173 CharacterOffsetEnd=179 PartOfSpeech=VB Lemma=become NamedEntityTag=O]\r\n[Text=a CharacterOffsetBegin=180 CharacterOffsetEnd=181 PartOfSpeech=DT Lemma=a NamedEntityTag=O]\r\n[Text=nursing CharacterOffsetBegin=182 CharacterOffsetEnd=189 PartOfSpeech=NN Lemma=nursing NamedEntityTag=O]\r\n[Text=home CharacterOffsetBegin=190 CharacterOffsetEnd=194 PartOfSpeech=NN Lemma=home NamedEntityTag=O]\r\n[Text=for CharacterOffsetBegin=195 CharacterOffsetEnd=198 PartOfSpeech=IN Lemma=for NamedEntityTag=O]\r\n[Text=AIDS CharacterOffsetBegin=199 CharacterOffsetEnd=203 PartOfSpeech=NN Lemma=aid NamedEntityTag=MISC]\r\n[Text=patients CharacterOffsetBegin=204 CharacterOffsetEnd=212 PartOfSpeech=NNS Lemma=patient NamedEntityTag=O]\r\n[Text=. CharacterOffsetBegin=212 CharacterOffsetEnd=213 PartOfSpeech=. Lemma=. NamedEntityTag=O]\r\nNLP> NLP> '
Traceback (most recent call last):
  File "amr_parsing.py", line 436, in <module>
    main()
  File "amr_parsing.py", line 169, in main
    instances = preprocess(amr_file,START_SNLP=True,INPUT_AMR=args.amrfmt, PRP_FORMAT=args.prpfmt)
  File "/home/xx/camr/preprocessing.py", line 377, in preprocess
    amr = AMR.parse_string(amr_strings[i])
  File "/home/xx/camr/common/AMRGraph.py", line 143, in parse_string
    else: raise ParserError, "Unexpected token %s"%(token)
common.AMRGraph.ParserError: Unexpected token :op2
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

1 participant