/// <summary> /// Adds a feature generator to this set of feature generators. /// </summary> /// <param name="featureGenerator">The feature generator to add.</param> public void AddFeatureGenerator(IAdaptiveFeatureGenerator featureGenerator) { if (featureGenerator == null) { throw new ArgumentNullException(nameof(featureGenerator)); } featureGenerators.Add(featureGenerator); }
/// <summary> /// Initializes the current instance with the given parameters. /// </summary> /// <param name="generator">Feature generator to apply to the window.</param> /// <param name="prevWindowSize">Size of the window to the left of the current token.</param> /// <param name="nextWindowSize">Size of the window to the right of the current token.</param> public WindowFeatureGenerator(IAdaptiveFeatureGenerator generator, int prevWindowSize, int nextWindowSize) { this.generator = generator; this.prevWindowSize = prevWindowSize; this.nextWindowSize = nextWindowSize; }
/// <summary> /// Initializes the current instance. The previous and next window size is 5. /// </summary> /// <param name="generator">The feature generator.</param> public WindowFeatureGenerator(IAdaptiveFeatureGenerator generator) : this(generator, 5, 5) { }
/// <summary> /// Initializes a new instance of the <see cref="NameSampleSequenceStream"/> class. /// </summary> /// <param name="psi">The sample stream.</param> /// <param name="featureGen">The feature generator.</param> public NameSampleSequenceStream(IObjectStream <NameSample> psi, IAdaptiveFeatureGenerator featureGen) : this(psi, new DefaultNameContextGenerator(featureGen), true) { }
/// <summary> /// Initializes a new instance of the <see cref="NameSampleSequenceStream"/> class. /// </summary> /// <param name="psi">The sample stream.</param> /// <param name="featureGen">The feature generator.</param> /// <param name="useOutcomes">if set to <c>true</c> will be used in the samples.</param> public NameSampleSequenceStream(IObjectStream <NameSample> psi, IAdaptiveFeatureGenerator featureGen, bool useOutcomes) : this(psi, new DefaultNameContextGenerator(featureGen), useOutcomes) { }
/// <summary> /// Initializes a new instance of the <see cref="NameSampleSequenceStream"/> class. /// </summary> /// <param name="psi">The sample stream.</param> /// <param name="featureGen">The feature generator.</param> /// <param name="useOutcomes">if set to <c>true</c> will be used in the samples.</param> public NameSampleSequenceStream(IObjectStream<NameSample> psi, IAdaptiveFeatureGenerator featureGen, bool useOutcomes) : this(psi, new DefaultNameContextGenerator(featureGen), useOutcomes) {}
/// <summary> /// Adds a feature generator to this set of feature generators. /// </summary> /// <param name="featureGenerator">The feature generator to add.</param> public void AddFeatureGenerator(IAdaptiveFeatureGenerator featureGenerator) { if (featureGenerator == null) throw new ArgumentNullException("featureGenerator"); featureGenerators.Add(featureGenerator); }
/// <summary> /// Initializes a new instance of the <see cref="NameSampleSequenceStream"/> class. /// </summary> /// <param name="psi">The sample stream.</param> /// <param name="featureGen">The feature generator.</param> public NameSampleSequenceStream(IObjectStream<NameSample> psi, IAdaptiveFeatureGenerator featureGen) : this(psi, new DefaultNameContextGenerator(featureGen), true) {}
public CachedFeatureGenerator(params IAdaptiveFeatureGenerator[] generators) { generator = new AggregatedFeatureGenerator(generators); contextsCache = new Cache(100); }
/// <summary> /// Initializes the current instance with the given parameters. /// </summary> /// <param name="generator">Feature generator to apply to the window.</param> /// <param name="prevWindowSize">Size of the window to the left of the current token.</param> /// <param name="nextWindowSize">Size of the window to the right of the current token.</param> public WindowFeatureGenerator(IAdaptiveFeatureGenerator generator, int prevWindowSize, int nextWindowSize) { this.generator = generator; this.prevWindowSize = prevWindowSize; this.nextWindowSize = nextWindowSize; }
/// <summary> /// Initializes the current instance. The previous and next window size is 5. /// </summary> /// <param name="generator">The feature generator.</param> public WindowFeatureGenerator(IAdaptiveFeatureGenerator generator) : this(generator, 5, 5) {}
public CachedFeatureGenerator(params IAdaptiveFeatureGenerator[] generators) { generator = new AggregatedFeatureGenerator(generators); contextsCache = new Cache(100); }