jcyk/AMR-gs

TypeError: string indices must be integers

Closed this issue · 2 comments

When I run the command sh annotate_features.sh data/AMR/amr_2.0, it will report an error: TypeError: string indices must be integers
details as follows:
File "../AMR-gs/stog/data/dataset_readers/amr_parsing/preprocess/feature_annotator.py", line 205, in
annotation = annotator(amr.sentence)
File "../AMR-gs/stog/data/dataset_readers/amr_parsing/preprocess/feature_annotator.py", line 75, in call
annotation = self.annotate(text)
File "../AMR-gs/stog/data/dataset_readers/amr_parsing/preprocess/feature_annotator.py", line 63, in annotate
tokens = self.nlp.annotate(text.strip(), self.nlp_properties)['sentences'][0]['tokens']
TypeError: string indices must be integers

What can cause this? Looking forward to your reply, thank you very much!

jcyk commented

Hi, this is likely due to a different version of Stanford CoreNLP. Please make sure your Stanford CoreNLP service is running correctly and the connection to the server is good.

I would like to ask, for Stanford CoreNLP version, should it be same as the script (3.9.2) or could it be higher? And I still don't understand whether while running CoreNLP server use sh run_standford_corenlp_server.sh or also setting as listed in https://stanfordnlp.github.io/CoreNLP/corenlp-server.html ? Thank you very much.