/** * Initializes the current instance via samples and feature generators. * * @param data {@link ObjectStream} of {@link DocumentSample}s * * @param featureGenerators the feature generators */ public DocumentCategorizerEventStream(ObjectStream<DocumentSample> data, FeatureGenerator... featureGenerators) { super(data); mContextGenerator = new DocumentCategorizerContextGenerator(featureGenerators); }
/** * Categorize the given text provided as tokens along with * the provided extra information * * @param text text tokens to categorize * @param extraInformation additional information */ @Override public double[] categorize(String[] text, Map<String, Object> extraInformation) { return model.getMaxentModel().eval( mContextGenerator.getContext(text, extraInformation)); }
/** * Initializes the current instance with a doccat model. Default feature * generation is used. * * @param model the doccat model */ public DocumentCategorizerME(DoccatModel model) { this.model = model; this.mContextGenerator = new DocumentCategorizerContextGenerator(this.model .getFactory().getFeatureGenerators()); }
public Event next() { isVirgin = false; return new Event(sample.getCategory(), mContextGenerator.getContext(sample.getText(), sample.getExtraInformation())); }
/** * Initializes the current instance. * * @param samples {@link ObjectStream} of {@link DocumentSample}s */ public DocumentCategorizerEventStream(ObjectStream<DocumentSample> samples) { super(samples); mContextGenerator = new DocumentCategorizerContextGenerator(new BagOfWordsFeatureGenerator()); }
/** * Categorize the given text provided as tokens along with * the provided extra information * * @param text text tokens to categorize * @param extraInformation additional information */ @Override public double[] categorize(String[] text, Map<String, Object> extraInformation) { return model.getMaxentModel().eval( mContextGenerator.getContext(text, extraInformation)); }
/** * Initializes the current instance via samples and feature generators. * * @param data {@link ObjectStream} of {@link DocumentSample}s * * @param featureGenerators the feature generators */ public DocumentCategorizerEventStream(ObjectStream<DocumentSample> data, FeatureGenerator... featureGenerators) { super(data); mContextGenerator = new DocumentCategorizerContextGenerator(featureGenerators); }
/** * Categorize the given text provided as tokens along with * the provided extra information * * @param text text tokens to categorize * @param extraInformation additional information */ @Override public double[] categorize(String[] text, Map<String, Object> extraInformation) { return model.getMaxentModel().eval( mContextGenerator.getContext(text, extraInformation)); }
/** * Initializes the current instance via samples and feature generators. * * @param data {@link ObjectStream} of {@link DocumentSample}s * * @param featureGenerators the feature generators */ public DocumentCategorizerEventStream(ObjectStream<DocumentSample> data, FeatureGenerator... featureGenerators) { super(data); mContextGenerator = new DocumentCategorizerContextGenerator(featureGenerators); }
public Event next() { isVirgin = false; return new Event(sample.getCategory(), mContextGenerator.getContext(sample.getText(), sample.getExtraInformation())); }
/** * Initializes the current instance with a doccat model. Default feature * generation is used. * * @param model the doccat model */ public DocumentCategorizerME(DoccatModel model) { this.model = model; this.mContextGenerator = new DocumentCategorizerContextGenerator(this.model .getFactory().getFeatureGenerators()); }
public Event next() { isVirgin = false; return new Event(sample.getCategory(), mContextGenerator.getContext(sample.getText(), sample.getExtraInformation())); }
/** * Initializes the current instance with a doccat model. Default feature * generation is used. * * @param model the doccat model */ public DocumentCategorizerME(DoccatModel model) { this.model = model; this.mContextGenerator = new DocumentCategorizerContextGenerator(this.model .getFactory().getFeatureGenerators()); }
/** * Initializes the current instance. * * @param samples {@link ObjectStream} of {@link DocumentSample}s */ public DocumentCategorizerEventStream(ObjectStream<DocumentSample> samples) { super(samples); mContextGenerator = new DocumentCategorizerContextGenerator(new BagOfWordsFeatureGenerator()); }
/** * Initializes the current instance. * * @param samples {@link ObjectStream} of {@link DocumentSample}s */ public DocumentCategorizerEventStream(ObjectStream<DocumentSample> samples) { super(samples); mContextGenerator = new DocumentCategorizerContextGenerator(new BagOfWordsFeatureGenerator()); }