/// <summary> /// Initializes a new instance of the <see cref="DocumentCategorizerME"/> with a document categorizer model. /// The default feature generation will be used. /// </summary> /// <param name="model">The model.</param> /// <exception cref="System.ArgumentNullException">model</exception> public DocumentCategorizerME(DocumentCategorizerModel model) { if (model == null) throw new ArgumentNullException("model"); cg = new DocumentCategorizerContextGenerator(model.Factory.FeatureGenerators); this.model = model; }
/// <summary> /// Initializes a new instance of the <see cref="DocumentCategorizerME"/> with a document categorizer model. /// The default feature generation will be used. /// </summary> /// <param name="model">The model.</param> /// <exception cref="System.ArgumentNullException">model</exception> public DocumentCategorizerME(DocumentCategorizerModel model) { if (model == null) { throw new ArgumentNullException("model"); } cg = new DocumentCategorizerContextGenerator(model.Factory.FeatureGenerators); this.model = model; }
/// <summary> /// Initializes a new instance of the <see cref="DocumentCategorizerEventStream"/> class with the given feature generators. /// </summary> /// <param name="samples">The samples.</param> /// <param name="featureGenerators">The feature generators.</param> /// <exception cref="System.ArgumentNullException">featureGenerators</exception> /// <exception cref="System.ArgumentOutOfRangeException">featureGenerators</exception> public DocumentCategorizerEventStream(IObjectStream <DocumentSample> samples, params IFeatureGenerator[] featureGenerators) : base(samples) { if (featureGenerators == null) { throw new ArgumentNullException("featureGenerators"); } if (featureGenerators.Length == 0) { throw new ArgumentOutOfRangeException("featureGenerators"); } cg = new DocumentCategorizerContextGenerator(featureGenerators); }