def fit(self, text, epochs=EPOCHS):
        """ Given a string `text`, use it to train the segmentation classifier for `epochs` iterations.
        """
        logger.debug("Extracting features and classifications.")
        Phi = []
        Y = []
        for (L, P, R, gold, _) in Detector.candidates(text):
            Phi.append(self.extract_one(L, P, R))
            Y.append(gold)
        self.classifier.fit(Y, Phi, epochs)
        logger.debug("Fitting complete.")