public class CRFTagger extends Object implements Tagger
| Modifier and Type | Field and Description |
|---|---|
protected cc.mallet.fst.CRF |
model |
| Modifier | Constructor and Description |
|---|---|
protected |
CRFTagger(cc.mallet.fst.CRF model,
FeatureSet featureSet,
int order) |
| Modifier and Type | Method and Description |
|---|---|
void |
describe(String fileName) |
Set<String> |
getFeatureNames() |
List<List<String>> |
getFeatureRepresentation(Sentence sentence) |
protected cc.mallet.types.Instance |
getInstance(Sentence sentence) |
Map<String,Double> |
getMaxWeights() |
Map<String,Double> |
getMinWeights() |
int |
getOrder() |
protected static List<String> |
getTagList(cc.mallet.types.Sequence<Object> tags) |
static CRFTagger |
load(InputStream f,
dragon.nlp.tool.Lemmatiser lemmatiser,
dragon.nlp.tool.Tagger posTagger,
Tagger preTagger)
Loads a
CRFTagger from the specified file. |
void |
tag(Sentence sentence)
|
static CRFTagger |
train(Set<Sentence> sentences,
int order,
TagFormat format,
FeatureSet featureSet)
|
void |
write(File f)
Serializes and writes this CRFTagger to the specified file
|
protected CRFTagger(cc.mallet.fst.CRF model,
FeatureSet featureSet,
int order)
public static CRFTagger load(InputStream f, dragon.nlp.tool.Lemmatiser lemmatiser, dragon.nlp.tool.Tagger posTagger, Tagger preTagger) throws IOException
CRFTagger from the specified file. As the lemmatiser and
part-of-speech tagger both require data, these cannot be written to disk
and must be passed in new.f - The file to load the CRFTagger from, as written by the
write() method.lemmatiser - The Lemmatiser to useposTagger - The part-of-speech Tagger to useIOExceptionpublic static CRFTagger train(Set<Sentence> sentences, int order, TagFormat format, FeatureSet featureSet)
public void write(File f)
f - The file to write this CRFTagger toprotected cc.mallet.types.Instance getInstance(Sentence sentence)
public int getOrder()
public void describe(String fileName) throws IOException
IOExceptionCopyright © 2018 JULIE Lab, Germany. All rights reserved.