de.fu_berlin.ties.context
Class Representation

java.lang.Object
  extended byde.fu_berlin.ties.context.Representation
Direct Known Subclasses:
DefaultRepresentation

public abstract class Representation
extends Object

Abstract class that manages context representations for entity recognition and information extraction. Subclasses must implement the buildContext(Element, String, String, String, PriorRecognitions, Map) method for building representations.

Version:
$Revision: 1.6 $, $Date: 2004/03/31 12:09:10 $, $Author: siefkes $
Author:
Christian Siefkes

Constructor Summary
Representation(int recogNum)
          Creates a new instance.
 
Method Summary
abstract  FeatureVector buildContext(Element element, String leftText, String mainText, String rightText, PriorRecognitions priorRecognitions, Map featureCache)
          Builds the context representation of text in an element.
 PriorRecognitions createRecognitionBuffer()
          Creates a buffer to be filled with prior Recognitions and passed as argument to the buildContext(Element, String, String, String, PriorRecognitions, Map) method.
 int getRecognitionNumber()
          Returns the number of preceding recognitions to represent.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Representation

public Representation(int recogNum)
Creates a new instance.

Parameters:
recogNum - the number of preceding recognitions to represent
Method Detail

buildContext

public abstract FeatureVector buildContext(Element element,
                                           String leftText,
                                           String mainText,
                                           String rightText,
                                           PriorRecognitions priorRecognitions,
                                           Map featureCache)
                                    throws ClassCastException
Builds the context representation of text in an element. Returns a feature vector of all context features considered relevant for representation.

Parameters:
element - the element whose context should be represented
leftText - textual content to the left of (preceding) mainText, might be empty
mainText - the main textual content to represent, might be empty
rightText - textual content to the right of (following) mainText, might be empty
priorRecognitions - a buffer of the last Recognitions from the document, created by calling createRecognitionBuffer()
featureCache - a cache of (local) feature, should be re-used between all calls for the nodes in a single document (but must not be re-used when building the context of nodes in different documents!)
Returns:
a vector of features considered relevant for representation
Throws:
ClassCastException - if the priorRecognitions buffer contains objects that aren't Recognitions

createRecognitionBuffer

public PriorRecognitions createRecognitionBuffer()
Creates a buffer to be filled with prior Recognitions and passed as argument to the buildContext(Element, String, String, String, PriorRecognitions, Map) method. The caller must PriorRecognitions.add(Recognition) new recognitions to the buffer but it is not necessary to remove them -- the buffer will automatically delete the oldest recognitions when appropriate.

Returns:
a buffer to be used for collecting prior Recognitions

getRecognitionNumber

public int getRecognitionNumber()
Returns the number of preceding recognitions to represent.

Returns:
the value of the attibute

toString

public String toString()
Returns a string representation of this object.

Returns:
a textual representation


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.