d@74: (in-package "AMUSE-SEGMENTATION") d@74: d@74: (defgeneric boundary-strength (segmenter object composition) d@74: (:documentation "Returns a (positive?) number, with 0 d@74: indicating no boundary. N.B. Whether this indicates a boundary m@140: before or after a moment is the responsibility of the caller to m@140: know.")) d@74: d@74: (defgeneric boundary-time (segmenter object) d@74: (:documentation "Returns the moment that the value returned by d@74: boundary-strength applies to if object is the second input to d@74: the method. Essentially, this distinguishes between segmenters d@74: that look to the beginning of a note and those that look at the d@75: end.")) d@74: d@74: (defgeneric ground-truth-segmenter-before (composition) d@74: (:documentation "Returns the segmenter that, when put into d@74: boundary-strength, supplies segmentation as given in a d@74: ground truth for the composition. N.B. This needs to return one d@74: segmenter only, so in cases of multiple ground truths, this d@74: method must arbitrate.")) d@74: d@74: (defgeneric ground-truth-segmenter-after (composition) d@74: (:documentation "Returns the segmenter that, when put into d@74: boundary-strength-after, supplies segmentation as given in a d@74: ground truth for the composition. N.B. This needs to return one d@74: segmenter only, so in cases of multiple ground truths, this d@74: method must arbitrate.")) d@74: d@75: (defgeneric ground-truth-segmenterp (segmenter) d@75: (:method ((s ground-truth-segmenter)) t) d@75: (:method (s) nil)) ;; prob not necessary? d@75: (defgeneric segments-beforep (segmenter) d@75: (:method ((s before-segmenter)) t) d@75: (:method ((s after-segmenter)) nil)) d@74: (defgeneric segments-afterp (segmenter) d@74: (:method (s) (not (segments-beforep s)))) d@80: d@80: (defgeneric make-segmentation (segmenter composition) d@80: (:documentation "Basic way to generate segmentation d@80: object. N.B. Requires segmenter to do more work than d@80: hitherto.")) d@80: d@80: (defgeneric ground-truth-segmentation (segmentation) d@80: (:documentation "Returns the relevant ground-truth for d@80: evaluating segmentation")) d@80: (defgeneric (setf ground-truth-segmentation) (segmentation value) d@80: (:documentation "Sets the segmentation to be used as ground d@80: truth by segmentation to value")) d@80: (defgeneric precision (segmentation) m@85: (:documentation "Returns the precision ratio for segmentation d@80: when compared with the (ground-truth-segmentation d@80: segmentation)")) d@80: (defgeneric recall (segmentation) m@85: (:documentation "Returns the precision ratio for segmentation d@80: when compared with the (ground-truth-segmentation d@80: segmentation)")) d@80: (defgeneric fall-out (segmentation) m@85: (:documentation "Returns the precision ratio for segmentation d@80: when compared with the (ground-truth-segmentation d@80: segmentation)")) d@80: (defgeneric F-measure (segmentation) m@85: (:documentation "Returns the precision ratio for segmentation d@80: when compared with the (ground-truth-segmentation d@80: segmentation)")) d@80: d@80: (defgeneric boundary-list (segmentation) d@80: (:documentation "Returns a list of moments corresponding to the d@80: boundary points of the segmentation")) d@80: (defgeneric segment-list (segmentation) d@80: (:documentation "Returns a list of anchored periods m@85: corresponding to the segments resulting from the segmentation"))