ncbi-nlp / NegBio

:newspaper: High-performance tool for negation and uncertainty detection in radiology reports
Other
156 stars 42 forks source link

TypeError: convert_trees() got an unexpected keyword argument 'add_lemmas' #39

Closed sush1996 closed 3 years ago

sush1996 commented 4 years ago

Not sure how to proceed with resolving this.

kaushikacharya commented 4 years ago

@sush1996 It would be better if you show the entire error stack here.

You need to check whether you have JPype1 installed in your m/c. Check if this command works: import jpype

Here's the workflow: https://github.com/ncbi-nlp/NegBio/blob/master/negbio/pipeline/ptb2ud.py#L64 Depending on whether jpype is present or not, self._backend gets assigned.

And depending on that, program decides which convert_tree() gets executed by the code block starting from https://github.com/ncbi-nlp/NegBio/blob/master/negbio/pipeline/ptb2ud.py#L84

if self._backend == 'jpype':
            dependency_graph = self.__sd.convert_tree(parse_tree,
                                                      representation=self.representation,
                                                      universal=self.universal,
                                                      add_lemmas=True)
        else:
            dependency_graph = self.__sd.convert_tree(parse_tree,
                                                      representation=self.representation,
                                                      universal=self.universal)
  1. https://github.com/dmcc/PyStanfordDependencies/blob/master/StanfordDependencies/JPypeBackend.py#L86
  2. https://github.com/dmcc/PyStanfordDependencies/blob/43d8f38a19e40087f273330087918c87df6d4d8f/StanfordDependencies/StanfordDependencies.py#L119

In case of StanfordDependencies.py convert_trees() is called by convert_tree()