def __init__(
        self, session, mention_classes, mention_spaces, matchers, parallelism=1
    ):
        """Initialize the MentionExtractor."""
        super(MentionExtractor, self).__init__(
            session,
            MentionExtractorUDF,
            parallelism=parallelism,
            mention_classes=mention_classes,
            mention_spaces=mention_spaces,
            matchers=matchers,
        )
        # Check that arity is same
        arity = len(mention_classes)
        if not all(
            len(x) == arity for x in [mention_classes, mention_spaces, matchers]
        ):
            raise ValueError(
                "Mismatched arity of mention classes, spaces, and matchers."
            )

        self.mention_classes = mention_classes
def __init__ ( self , session , mention_classes , mention_spaces , matchers , parallelism = 1 ) : super ( MentionExtractor , self ) . __init__ ( session , MentionExtractorUDF , parallelism = parallelism , mention_classes = mention_classes , mention_spaces = mention_spaces , matchers = matchers , ) arity = len ( mention_classes ) if not all ( len ( x ) == arity for x in [ mention_classes , mention_spaces , matchers ] ) : raise ValueError ( "Mismatched arity of mention classes, spaces, and matchers." ) self . mention_classes = mention_classes
Initialize the MentionExtractor.