dist/multilabel/BinarySegmentation.js
function(opts) {
	if (!('binaryClassifierType' in opts)) {
		console.dir(opts);
		throw new Error("opts must contain binaryClassifierType");
	}
	if (!opts.binaryClassifierType) {
		console.dir(opts);
		throw new Error("opts.binaryClassifierType is null");
	}

	this.binaryClassifierType = opts.binaryClassifierType;
	this.classifier = new this.binaryClassifierType();

	switch (opts.segmentSplitStrategy) {
	case 'shortestSegment': this.segmentSplitStrategy = this.shortestSegmentSplitStrategy; break;
	case 'longestSegment':  this.segmentSplitStrategy = this.longestSegmentSplitStrategy;  break;
	case 'cheapestSegment':  this.segmentSplitStrategy = this.cheapestSegmentSplitStrategy;  break;
	default: this.segmentSplitStrategy = null;
	}
	
	this.mapClassnameToClassifier = {};
}
function(opts) {
	if (!('binaryClassifierType' in opts)) {
		console.dir(opts);
		throw new Error("opts must contain binaryClassifierType");
	}
	if (!opts.binaryClassifierType) {
		console.dir(opts);
		throw new Error("opts.binaryClassifierType is null");
	}

	this.binaryClassifierType = opts.binaryClassifierType;
	this.classifier = new this.binaryClassifierType();

	switch (opts.segmentSplitStrategy) {
	case 'shortestSegment': this.segmentSplitStrategy = this.shortestSegmentSplitStrategy; break;
	case 'longestSegment':  this.segmentSplitStrategy = this.longestSegmentSplitStrategy;  break;
	case 'cheapestSegment':  this.segmentSplitStrategy = this.cheapestSegmentSplitStrategy;  break;
	default: this.segmentSplitStrategy = null;
	}
	
	this.mapClassnameToClassifier = {};
}
function ( opts ) { if ( ! ( 'binaryClassifierType' in opts ) ) { console . dir ( opts ) ; throw new Error ( "opts must contain binaryClassifierType" ) ; } if ( ! opts . binaryClassifierType ) { console . dir ( opts ) ; throw new Error ( "opts.binaryClassifierType is null" ) ; } this . binaryClassifierType = opts . binaryClassifierType ; this . classifier = new this . binaryClassifierType ( ) ; switch ( opts . segmentSplitStrategy ) { case 'shortestSegment' : this . segmentSplitStrategy = this . shortestSegmentSplitStrategy ; break ; case 'longestSegment' : this . segmentSplitStrategy = this . longestSegmentSplitStrategy ; break ; case 'cheapestSegment' : this . segmentSplitStrategy = this . cheapestSegmentSplitStrategy ; break ; default : this . segmentSplitStrategy = null ; } this . mapClassnameToClassifier = { } ; }
BinarySegmentation - Multi-label text classifier, based on a segmentation scheme using base binary classifiers.

Inspired by:

Morbini Fabrizio, Sagae Kenji. Joint Identification and Segmentation of Domain-Specific Dialogue Acts for Conversational Dialogue Systems. ACL-HLT 2011
http://www.citeulike.org/user/erelsegal-halevi/article/10259046

@author Erel Segal-haLevi

@param opts
binaryClassifierType (mandatory) - the type of the base binary classifier.
featureExtractor (optional) - a single feature-extractor (see the "features" folder), or an array of extractors, for extracting features from the text segments during classification.
BinarySegmentation - Multi - label text classifier based on a segmentation scheme using base binary classifiers .