/// <summary> /// Create an event reader based on the specified data reader of the specified type using the specified head rules. /// </summary> /// <param name="dataReader"> /// A 1-parse-per-line Penn Treebank Style parse. /// </param> /// <param name="rules"> /// The head rules. /// </param> /// <param name="eventType"> /// The type of events desired (tag, chunk, build, or check). /// </param> public ParserEventReader(SharpEntropy.ITrainingDataReader <string> dataReader, IHeadRules rules, EventType eventType) { if (eventType == EventType.Build) { mBuildContextGenerator = new BuildContextGenerator(); } else if (eventType == EventType.Check) { mCheckContextGenerator = new CheckContextGenerator(); } else if (eventType == EventType.Chunk) { mChunkContextGenerator = new ChunkContextGenerator(); } else if (eventType == EventType.Tag) { mPosContextGenerator = new POS_ContextGenerator(); } mHeadRules = rules; mEventType = eventType; mDataReader = dataReader; mEventIndex = 0; if (dataReader.HasNext()) { AddNewEvents(); } else { mEvents = new SharpEntropy.TrainingEvent[0]; } }
public MaximumEntropyPosTagger(int beamSize, SharpEntropy.IMaximumEntropyModel model, IPosContextGenerator contextGenerator, PosLookupList dictionary) { mBeamSize = beamSize; mPosModel = model; mContextGenerator = contextGenerator; Beam = new PosBeamSearch(this, mBeamSize, contextGenerator, model); mDictionary = dictionary; }
public MaximumEntropyPOSTagger(int beamSize, MaxEntropyModel_Interface model, IPosContextGenerator contextGenerator, Interfaces.PosLookupList dictionary) { mBeamSize = beamSize; mPosModel = model; mContextGenerator = contextGenerator; Beam = new PosBeamSearch(this, mBeamSize, contextGenerator, model); mDictionary = dictionary; }
public PosEventReader(System.IO.TextReader data, IPosContextGenerator contextGenerator) { mContextGenerator = contextGenerator; mTextReader = data; string nextLine = mTextReader.ReadLine(); if (nextLine != null) { AddEvents(nextLine); } }
public PosEventReader(System.IO.TextReader data, IPosContextGenerator contextGenerator) { _contextGenerator = contextGenerator; _textReader = data; string nextLine = _textReader.ReadLine(); if (nextLine != null) { AddEvents(nextLine); } }
public PosBeamSearch(MaximumEntropyPosTagger posTagger, int size, IPosContextGenerator contextGenerator, SharpEntropy.IMaximumEntropyModel model, int cacheSize) : base(size, contextGenerator, model, cacheSize) { _maxentPosTagger = posTagger; }
public MaximumEntropyPosTagger(int beamSize, SharpEntropy.IMaximumEntropyModel model, IPosContextGenerator contextGenerator, PosLookupList dictionary) { UseClosedClassTagsFilter = false; this.BeamSize = beamSize; this.PosModel = model; this.ContextGenerator = contextGenerator; Beam = new PosBeamSearch(this, this.BeamSize, contextGenerator, model); this.TagDictionary = dictionary; }
public MaximumEntropyPosTagger(SharpEntropy.IMaximumEntropyModel model, IPosContextGenerator contextGenerator, PosLookupList dictionary) : this(DefaultBeamSize, model, contextGenerator, dictionary) { }
public MaximumEntropyPosTagger(SharpEntropy.IMaximumEntropyModel model, IPosContextGenerator contextGenerator) : this(DefaultBeamSize, model, contextGenerator, null) { }
public PosBeamSearch(MaximumEntropyPosTagger posTagger, int size, IPosContextGenerator contextGenerator, SharpEntropy.IMaximumEntropyModel model, int cacheSize) : base(size, contextGenerator, model, cacheSize) { mMaxentPosTagger = posTagger; }
public MaximumEntropyPosTagger(SharpEntropy.IMaximumEntropyModel model, IPosContextGenerator contextGenerator, PosLookupList dictionary) : this(mDefaultBeamSize, model, contextGenerator, dictionary) { }
public MaximumEntropyPosTagger(SharpEntropy.IMaximumEntropyModel model, IPosContextGenerator contextGenerator) : this(mDefaultBeamSize, model, contextGenerator, null) { }
public MaximumEntropyPOSTagger(MaxEntropyModel_Interface model, IPosContextGenerator contextGenerator, Interfaces.PosLookupList dictionary) : this(mDefaultBeamSize, model, contextGenerator, dictionary) { }
public MaximumEntropyPOSTagger(MaxEntropyModel_Interface model, IPosContextGenerator contextGenerator) : this(mDefaultBeamSize, model, contextGenerator, null) { }