edu.stanford.nlp.ie.hmm
Class HMMSingleFieldExtractor

java.lang.Object
  |
  +--edu.stanford.nlp.ie.AbstractFieldExtractor
        |
        +--edu.stanford.nlp.ie.SingleFieldExtractor
              |
              +--edu.stanford.nlp.ie.hmm.HMMSingleFieldExtractor
All Implemented Interfaces:
FieldExtractor, RankedExtractor, Serializable

public class HMMSingleFieldExtractor
extends SingleFieldExtractor

An interface between the KAON extraction world, and extraction of a single field via an HMM information extractor.

See Also:
Serialized Form

Constructor Summary
HMMSingleFieldExtractor(String relation)
           
 
Method Summary
 String extractField(edu.unika.aifb.kaon.Instance i, String text)
          Subclasses should override this method to perform extraction from the given text.
 String getDescription()
          Returns a brief (one line) description of this FieldExtractor, suitable for printing.
 String getExtractableField()
           
 String getExtractableField(edu.unika.aifb.kaon.Concept c)
          Subclasses should override this method to return the name of the Relation they know how to extract, or null if this field is not supported for the given Concept.
 boolean load(String hmmFile)
           
static void main(String[] args)
          Load a serialized HMM and write to serialized HMMSingleFieldExtractor.
 void setHMM(HMM h)
           
static void train(String[] args)
          Train an HMM and write to serialized HMMSingleFieldExtractor
 
Methods inherited from class edu.stanford.nlp.ie.SingleFieldExtractor
extractField, extractFields, extractFields, getExtractableFields
 
Methods inherited from class edu.stanford.nlp.ie.AbstractFieldExtractor
isFieldExtractable, storeExtractor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HMMSingleFieldExtractor

public HMMSingleFieldExtractor(String relation)
Method Detail

main

public static void main(String[] args)
Load a serialized HMM and write to serialized HMMSingleFieldExtractor.

Parameters:
args - Command line arguments:
java HMMSingleFieldExtractor fieldName hmmfile objectOutputFile

train

public static void train(String[] args)
Train an HMM and write to serialized HMMSingleFieldExtractor


load

public boolean load(String hmmFile)

setHMM

public void setHMM(HMM h)

getExtractableField

public String getExtractableField(edu.unika.aifb.kaon.Concept c)
Subclasses should override this method to return the name of the Relation they know how to extract, or null if this field is not supported for the given Concept.

Specified by:
getExtractableField in class SingleFieldExtractor

getExtractableField

public String getExtractableField()

extractField

public String extractField(edu.unika.aifb.kaon.Instance i,
                           String text)
Subclasses should override this method to perform extraction from the given text. The Instance is provided only as a potentially additional source of information. Subclasses should just return the extracted text as a String, or null if no field is found in the given text.

Specified by:
extractField in class SingleFieldExtractor

getDescription

public String getDescription()
Returns a brief (one line) description of this FieldExtractor, suitable for printing.



Stanford NLP Group