stanfordmlgroup / chexpert-labeler

CheXpert NLP tool to extract observations from radiology reports.
MIT License
328 stars 78 forks source link

NegBioPtb2DepConverter constructor update #7

Closed kl2532 closed 5 years ago

kl2532 commented 5 years ago

When running python label.py --reports_path sample_reports.csv, the following error appears:

Traceback (most recent call last):
  File "label.py", line 51, in <module>
    label(parser.parse_args())
  File "label.py", line 33, in label
    verbose=args.verbose)
  File "chexpert-labeler/stages/classify.py", line 82, in __init__
    self.ptb2dep = ptb2ud.NegBioPtb2DepConverter(universal=True)
TypeError: __init__() missing 1 required positional argument: 'lemmatizer'

This error is due to an update in the constructor of NegBioPtb2DepConverter:

class NegBioPtb2DepConverter(Ptb2DepConverter):
    def __init__(self, lemmatizer, representation='CCprocessed', universal=False):
        """
        Args:
            lemmatizer (Lemmatizer)
        """
        super(NegBioPtb2DepConverter, self).__init__(lemmatizer, representation, universal)

https://github.com/ncbi-nlp/NegBio/blob/master/negbio/pipeline/ptb2ud.py#L95-L101

This fix includes the defined lemmatizer and addresses issue #6.