public class HMMNameTagger extends Object implements NameTagger
| Modifier and Type | Field and Description |
|---|---|
HMMannotator |
annotator |
HMM |
nameHMM |
| Constructor and Description |
|---|
HMMNameTagger(Class emitterClass)
creates a new HMMNameTagger (with an empty HMM).
|
| Modifier and Type | Method and Description |
|---|---|
void |
buildNameHMM(String tagFileName)
create the HMM states and arcs.
|
static boolean |
inZone(Document doc,
Span span,
String zoneType)
returns 'true' if Span 'span' is enclosed in an annotation of type
'zoneType'.
|
void |
load(String fileName)
load the tag table and the HMM associated with this tagger
from file 'fileName'.
|
static void |
main(String[] args)
procedure the named entity tagger on documents with in-line NE tags.
|
void |
newDocument() |
void |
store(String fileName)
store the tag table and the HMM associated with this tagger
to file 'fileName'.
|
void |
tag(Document doc,
Span span)
tag span 'span' of Document 'doc' with Named Entity annotations.
|
void |
tagDocument(Document doc) |
static void |
tagPersonZone(Document doc,
Span span,
HMMannotator annotator) |
void |
train(ExternalDocument doc) |
void |
train(String trainingCollection)
train the HMMNameTagger using the collection of Documents 'trainingCollection'.
|
void |
train(String directory,
String fileList) |
public HMM nameHMM
public HMMannotator annotator
public HMMNameTagger(Class emitterClass)
emitterClass - the class of the emitter associated with each state of
the HMM; must be a subclass of HMMemitter.public void buildNameHMM(String tagFileName)
Creates six states for each name type.
public void train(String trainingCollection) throws IOException
IOExceptionpublic void train(String directory, String fileList) throws IOException
IOExceptionpublic void train(ExternalDocument doc) throws IOException
IOExceptionpublic void store(String fileName) throws IOException
IOExceptionpublic void load(String fileName) throws IOException
load in interface NameTaggerIOExceptionpublic void tagDocument(Document doc)
tagDocument in interface NameTaggerpublic void newDocument()
newDocument in interface NameTaggerpublic void tag(Document doc, Span span)
tag in interface NameTaggerpublic static boolean inZone(Document doc, Span span, String zoneType)
public static void tagPersonZone(Document doc, Span span, HMMannotator annotator)
public static void main(String[] args) throws IOException
IOExceptionCopyright © 2016 New York University. All rights reserved.