public class CorpusAnnotationDiff extends AbstractVisualResource implements Scrollable
Modifier and Type | Class and Description |
---|---|
class |
CorpusAnnotationDiff.AnnotationDiffCellRenderer
This class defines a Cell renderer for the AnnotationDiff table
|
protected class |
CorpusAnnotationDiff.AnnotationDiffTableModel
A custom table model used to render a table containing the two annotation
sets.
|
protected class |
CorpusAnnotationDiff.DiffSetElement
This class is used for internal purposes.
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static int |
CORRECT_TYPE
A correct type when all annotation are corect represented by Green color
|
static int |
DEFAULT_TYPE
A default type when all annotation are the same represented by White color
|
static int |
MAX_TYPES
Field designated to represent the max nr of annot types and coolors for
each type
|
protected int |
maxUnitIncrement |
static int |
MISSING_TYPE
A missing type when annotations in key were not present in response
Represented by Yellow color
|
static int |
PARTIALLY_CORRECT_TYPE
A partially correct type when all annotation are corect represented
by Blue color
|
static int |
SPURIOUS_TYPE
A spurious type when annotations in response were not present in key.
|
static double |
weight
The weight used in F-measure (see NLP Information Extraction)
|
features, handle
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
CorpusAnnotationDiff()
Constructs a CorpusAnnotationDiff
|
Modifier and Type | Method and Description |
---|---|
protected void |
arangeAllComponents()
This method creates the graphic components and aranges them on
this JPanel
|
protected void |
doDiff(List<Annotation> aKeyAnnotList,
List<Annotation> aResponseAnnotList)
This method is the brain of the AnnotationSet diff and creates a set with
diffSetElement objects.
|
AnnotationSchema |
getAnnotationSchema() |
Set<Annotation> |
getAnnotationsOfType(int annotType)
Returns a set with all annotations of a specific type
|
String |
getAnnotationTypeForFalsePositive()
Gets the annotation type needed to calculate the falsePossitive measure
|
double |
getFalsePositiveAverage() |
double |
getFalsePositiveLenient() |
double |
getFalsePositiveStrict() |
double |
getFMeasureAverage() |
double |
getFMeasureLenient() |
double |
getFMeasureStrict() |
String |
getKeyAnnotationSetName()
Gets the keyAnnotationSetName.
|
Corpus |
getKeyCorpus() |
Set<?> |
getKeyFeatureNamesSet()
Gets the keyFeatureNamesSet in AnnotDiff.
|
Object |
getParameterValue(String paramaterName)
Gets the value of a parameter of this resource.
|
double |
getPrecisionAverage() |
double |
getPrecisionLenient() |
double |
getPrecisionStrict() |
Dimension |
getPreferredScrollableViewportSize() |
double |
getRecallAverage() |
double |
getRecallLenient() |
double |
getRecallStrict() |
String |
getResponseAnnotationSetName()
gets the responseAnnotationSetName.
|
String |
getResponseAnnotationSetNameFalsePoz()
gets the responseAnnotationSetNameFalsePoz.
|
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction) |
boolean |
getScrollableTracksViewportHeight() |
boolean |
getScrollableTracksViewportWidth() |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction) |
Resource |
init()
This method does the diff, Precision,Recall,FalsePositive
calculation and so on.
|
boolean |
isTextMode()
Gets the annot diff textmode.True means that the text mode is activated.
|
protected void |
printStructure(Set<CorpusAnnotationDiff.DiffSetElement> aDiffSet)
Used internally for debugging
|
void |
setAnnotationSchema(AnnotationSchema anAnnotationSchema) |
void |
setAnnotationTypeForFalsePositive(String anAnnotType)
Sets the annotation type needed to calculate the falsePossitive measure
|
void |
setKeyAnnotationSetName(String aKeyAnnotationSetName)
Sets the keyAnnotationSetName in AnnotDiff
|
void |
setKeyCorpus(Corpus aKeyCorpus)
Sets the keyCorpus in AnnotDiff
|
void |
setKeyFeatureNamesSet(Set<?> aKeyFeatureNamesSet)
Sets the keyFeatureNamesSet in AnnotDiff.
|
void |
setParameterValue(String paramaterName,
Object parameterValue)
Sets the value for a specified parameter.
|
void |
setParameterValues(FeatureMap parameters)
Sets the values for more parameters in one step.
|
void |
setResponseAnnotationSetName(String aResponseAnnotationSetName)
Sets the responseAnnotationSetName in AnnotDiff
|
void |
setResponseAnnotationSetNameFalsePoz(String aResponseAnnotationSetNameFalsePoz)
Sets the responseAnnotationSetNameFalsePoz in AnnotDiff
|
void |
setResponseCorpus(Corpus aResponseCorpus) |
void |
setTextMode(Boolean aTextMode)
Sets the annot diff to work in the text mode.This would not initiate the
GUI part of annot diff but it would calculate precision etc
|
cleanup, getFeatures, getInitParameterValues, setFeatures, setHandle, setTarget
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
targetReinitialised
getName, setName
protected int maxUnitIncrement
public static double weight
public static final int MAX_TYPES
public static final int DEFAULT_TYPE
public static final int CORRECT_TYPE
public static final int PARTIALLY_CORRECT_TYPE
public static final int SPURIOUS_TYPE
public static final int MISSING_TYPE
public CorpusAnnotationDiff()
public void setAnnotationTypeForFalsePositive(String anAnnotType)
anAnnotType
- is the annotation type needed to calculate a special
mesure called falsePossitive. Usualy the value is "token", but it can be
any other string with the same semantic.public String getAnnotationTypeForFalsePositive()
public void setKeyCorpus(Corpus aKeyCorpus)
aKeyCorpus
- The GATE corpus used as a key in annotation diff.public Corpus getKeyCorpus()
public void setKeyAnnotationSetName(String aKeyAnnotationSetName)
aKeyAnnotationSetName
- The name of the annotation set from the
keyDocument.If aKeyAnnotationSetName is null then the default annotation
set will be used.public String getKeyAnnotationSetName()
public void setKeyFeatureNamesSet(Set<?> aKeyFeatureNamesSet)
aKeyFeatureNamesSet
- a set containing the feature names from key
that will be used in isPartiallyCompatible()public Set<?> getKeyFeatureNamesSet()
public void setResponseAnnotationSetName(String aResponseAnnotationSetName)
aResponseAnnotationSetName
- The name of the annotation set from the
responseDocument.If aResponseAnnotationSetName is null then the default
annotation set will be used.public String getResponseAnnotationSetName()
public void setResponseAnnotationSetNameFalsePoz(String aResponseAnnotationSetNameFalsePoz)
aResponseAnnotationSetNameFalsePoz
- The name of the annotation set
from the responseDocument.If aResponseAnnotationSetName is null
then the default annotation set will be used.public String getResponseAnnotationSetNameFalsePoz()
public void setTextMode(Boolean aTextMode)
public boolean isTextMode()
public Set<Annotation> getAnnotationsOfType(int annotType)
public Object getParameterValue(String paramaterName) throws ResourceInstantiationException
getParameterValue
in interface Resource
getParameterValue
in class AbstractVisualResource
paramaterName
- the name of the parameterResourceInstantiationException
public void setParameterValue(String paramaterName, Object parameterValue) throws ResourceInstantiationException
setParameterValue
in interface Resource
setParameterValue
in class AbstractVisualResource
paramaterName
- the name for the parameteerparameterValue
- the value the parameter will receiveResourceInstantiationException
public void setParameterValues(FeatureMap parameters) throws ResourceInstantiationException
setParameterValues
in interface Resource
setParameterValues
in class AbstractVisualResource
parameters
- a feature map that has paramete names as keys and
parameter values as values.ResourceInstantiationException
public double getPrecisionStrict()
public double getPrecisionLenient()
public double getPrecisionAverage()
public double getFMeasureStrict()
public double getFMeasureLenient()
public double getFMeasureAverage()
public double getRecallStrict()
public double getRecallLenient()
public double getRecallAverage()
public double getFalsePositiveStrict()
public double getFalsePositiveLenient()
public double getFalsePositiveAverage()
public void setResponseCorpus(Corpus aResponseCorpus)
aResponseCorpus
- the GATE response corpus
containing the annotation Set being compared against the annotation from
the keyCorpus.public void setAnnotationSchema(AnnotationSchema anAnnotationSchema)
anAnnotationSchema
- the annotation type being compared.
This type is found in annotationSchema object as field
AnnotationSchema.getAnnotationName()
. If is null
then AnnotDiff will throw an exception when it comes to do the diff.public AnnotationSchema getAnnotationSchema()
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface Scrollable
public Resource init() throws ResourceInstantiationException
init
in interface Resource
init
in class AbstractVisualResource
ResourceInstantiationException
protected void arangeAllComponents()
protected void printStructure(Set<CorpusAnnotationDiff.DiffSetElement> aDiffSet)
protected void doDiff(List<Annotation> aKeyAnnotList, List<Annotation> aResponseAnnotList)
aKeyAnnotList
- a list containing the annotations from key. If this
param is null then the method will simply return and will not do a
thing.aResponseAnnotList
- a list containing the annotation from response.
If this param is null the method will return.Copyright © 2024 GATE. All rights reserved.