vj1494 / PipelineIE

PipelineIE is a project that contains a pipeline for information extraction (currently triple) from free text and domain specific text (eg. biomedical domain) and also supports custom models making it flexible to support other domains. It takes care of coreference resolution and entity resolution by also allowing to test with different tools.
MIT License
10 stars 1 forks source link

KeyError: 'parse' #1

Open nitshx opened 2 years ago

nitshx commented 2 years ago

Followed all steps under Installation. Trying to run the PipelineIE/PipelineIE.ipynb, but get this error

KeyError                                  Traceback (most recent call last)
PipelineIE/PipelineIE.ipynb in <module>
      8 
      9 #Returns a dataframe
---> 10 pie.pipeline_triplet()

~/Downloads/PipelineIE/pipeline_ie/pipeline_ie.py in pipeline_triplet(self)
     93             annotation = 'parse'
     94             sentence_simp = SentenceSimplify(sentences,annotation,memory,timeout)
---> 95             sentences = sentence_simp.sentence_simplify()
     96 
     97         #Entity Linking

~/Downloads/PipelineIE/pipeline_ie/sentence_simplification.py in sentence_simplify(self)
    106                 sentence = re.sub(r"(\.|,|\?|\(|\)|\[|\])", " ", sentence)
    107                 ann = client.annotate(sentence)
--> 108                 clause_list = self.get_clause_list(ann)
    109                 if not clause_list:
    110                     decomposed_sent.append(sentence)

~/Downloads/PipelineIE/pipeline_ie/sentence_simplification.py in get_clause_list(self, ann)
     62     def get_clause_list(self,ann):
     63         print(ann["sentences"][0])
---> 64         sent_tree = nltk.tree.ParentedTree.fromstring(ann["sentences"][0]["parse"])
     65         clause_level_list = ["S", "SBAR", "SBARQ", "SINV", "SQ"]
     66         clause_list = []

KeyError: 'parse'