gate.gui
Class CorpusQualityAssurance

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by gate.creole.AbstractVisualResource
                      extended by gate.gui.CorpusQualityAssurance
All Implemented Interfaces:
CorpusListener, Resource, FeatureBearer, NameBearer, VisualResource, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

@CreoleResource(name="Corpus Quality Assurance",
                guiType=LARGE,
                resourceDisplayed="gate.Corpus",
                mainViewer=false,
                helpURL="http://gate.ac.uk/userguide/sec:eval:corpusqualityassurance")
public class CorpusQualityAssurance
extends AbstractVisualResource
implements CorpusListener

Quality assurance corpus view. Compare two sets of annotations with optionally their features globally for each annotation and for each document inside a corpus with different measures notably precision, recall and F1-score.

See Also:
Serialized Form

Nested Class Summary
protected  class CorpusQualityAssurance.CompareAction
          Update document table.
protected  class CorpusQualityAssurance.ExportToHtmlAction
           
protected static class CorpusQualityAssurance.ExtendedListModel
           
protected  class CorpusQualityAssurance.HelpAction
           
protected  class CorpusQualityAssurance.SetBdmFileAction
           
protected static class CorpusQualityAssurance.ToggleSelectionABModel
          Add a suffix A and B for the first and second selected item.
protected static class CorpusQualityAssurance.ToggleSelectionModel
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  XJTable annotationTable
           
protected  DefaultTableModel annotationTableModel
           
protected  URL bdmFileUrl
           
protected static int CLASSIFICATION_MEASURES
           
protected  Collator collator
           
protected  CorpusQualityAssurance.CompareAction compareAction
           
protected  XJTable confusionTable
           
protected  DefaultTableModel confusionTableModel
           
protected  Corpus corpus
           
protected  boolean corpusChanged
           
protected  ArrayList<HashMap<String,AnnotationDiffer>> differsByDocThenType
          ordered by document as in the corpus then contains (annotation type * AnnotationDiffer)
protected  Map<String,TreeMap<String,TreeMap<String,TreeSet<String>>>> docsSetsTypesFeatures
          cache for document*set*type*feature names
protected  XJTable document2Table
           
protected  DefaultTableModel document2TableModel
           
protected  ArrayList<String> documentNames
           
protected  XJTable documentTable
           
protected  DefaultTableModel documentTableModel
           
protected  Comparator<String> doubleComparator
           
protected  CorpusQualityAssurance.ExportToHtmlAction exportToHtmlAction
           
protected  JCheckBox featureCheck
           
protected  JList featureList
           
protected  Object[] featuresSelected
           
protected static int FSCORE_MEASURES
           
protected  String keySetName
           
protected  JList measure2List
           
protected  JList measureList
           
protected  int measuresType
          FSCORE_MEASURES or CLASSIFICATION_MEASURES
protected  JTabbedPane measureTabbedPane
           
protected  gate.gui.CorpusQualityAssurance.OpenAnnotationDiffAction openAnnotationDiffAction
           
protected  gate.gui.CorpusQualityAssurance.OpenDocumentAction openDocumentAction
           
protected  JToggleButton optionsButton
           
protected  JProgressBar progressBar
           
protected  Thread readSetsTypesFeaturesThread
           
protected  gate.gui.CorpusQualityAssurance.ReloadCacheAction reloadCacheAction
           
protected  String responseSetName
           
protected  JCheckBox setCheck
           
protected  JList setList
           
protected  JTabbedPane tableTabbedPane
           
protected  Timer timer
           
protected  TimerTask timerTask
           
protected  Comparator<String> totalComparator
           
protected  JCheckBox typeCheck
           
protected  JList typeList
           
protected  TreeSet<String> types
           
protected  Object[] typesSelected
           
protected  OptionsMap userConfig
           
protected  JCheckBox verboseOptionCheckBox
           
 
Fields inherited from class gate.creole.AbstractVisualResource
features, handle
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CorpusQualityAssurance()
           
 
Method Summary
 void cleanup()
          Does nothing now, but meant to clear all internal data
protected  void compareAnnotation()
           
protected  String createToolTipFromColumnName(String columnName)
          Create a table header tool tips from the column name.
 void documentAdded(CorpusEvent e)
          Called when a document has been added
 void documentRemoved(CorpusEvent e)
          Called when a document has been removed
 Resource init()
          Initialise this resource, and return it.
protected  void initGuiComponents()
           
protected  void initListeners()
           
protected  void initLocalData()
           
protected  void printSummary(Object measureObject, DefaultTableModel tableModel, int columnGroupSize, int insertionRow, Object[] measures)
           
protected  void readSetsTypesFeatures(int documentStart)
          Update set lists.
 void setTarget(Object target)
          Called by the GUI when this viewer/editor has to initialise itself for a specific object.
protected  void updateSetList()
           
 
Methods inherited from class gate.creole.AbstractVisualResource
getFeatures, getInitParameterValues, getParameterValue, setFeatures, setHandle, setParameterValue, setParameterValues
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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
 
Methods inherited from class java.awt.Container
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, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Field Detail

corpus

protected Corpus corpus

corpusChanged

protected boolean corpusChanged

types

protected TreeSet<String> types

docsSetsTypesFeatures

protected final Map<String,TreeMap<String,TreeMap<String,TreeSet<String>>>> docsSetsTypesFeatures
cache for document*set*type*feature names


differsByDocThenType

protected ArrayList<HashMap<String,AnnotationDiffer>> differsByDocThenType
ordered by document as in the corpus then contains (annotation type * AnnotationDiffer)


documentNames

protected ArrayList<String> documentNames

keySetName

protected String keySetName

responseSetName

protected String responseSetName

typesSelected

protected Object[] typesSelected

featuresSelected

protected Object[] featuresSelected

timer

protected Timer timer

timerTask

protected TimerTask timerTask

readSetsTypesFeaturesThread

protected Thread readSetsTypesFeaturesThread

measuresType

protected int measuresType
FSCORE_MEASURES or CLASSIFICATION_MEASURES


FSCORE_MEASURES

protected static final int FSCORE_MEASURES
See Also:
Constant Field Values

CLASSIFICATION_MEASURES

protected static final int CLASSIFICATION_MEASURES
See Also:
Constant Field Values

collator

protected Collator collator

doubleComparator

protected Comparator<String> doubleComparator

totalComparator

protected Comparator<String> totalComparator

userConfig

protected OptionsMap userConfig

bdmFileUrl

protected URL bdmFileUrl

documentTable

protected XJTable documentTable

documentTableModel

protected DefaultTableModel documentTableModel

annotationTable

protected XJTable annotationTable

annotationTableModel

protected DefaultTableModel annotationTableModel

document2Table

protected XJTable document2Table

document2TableModel

protected DefaultTableModel document2TableModel

confusionTable

protected XJTable confusionTable

confusionTableModel

protected DefaultTableModel confusionTableModel

tableTabbedPane

protected JTabbedPane tableTabbedPane

setList

protected JList setList

typeList

protected JList typeList

featureList

protected JList featureList

optionsButton

protected JToggleButton optionsButton

measureTabbedPane

protected JTabbedPane measureTabbedPane

measureList

protected JList measureList

measure2List

protected JList measure2List

setCheck

protected JCheckBox setCheck

typeCheck

protected JCheckBox typeCheck

featureCheck

protected JCheckBox featureCheck

progressBar

protected JProgressBar progressBar

verboseOptionCheckBox

protected JCheckBox verboseOptionCheckBox

openDocumentAction

protected gate.gui.CorpusQualityAssurance.OpenDocumentAction openDocumentAction

openAnnotationDiffAction

protected gate.gui.CorpusQualityAssurance.OpenAnnotationDiffAction openAnnotationDiffAction

exportToHtmlAction

protected CorpusQualityAssurance.ExportToHtmlAction exportToHtmlAction

reloadCacheAction

protected gate.gui.CorpusQualityAssurance.ReloadCacheAction reloadCacheAction

compareAction

protected CorpusQualityAssurance.CompareAction compareAction
Constructor Detail

CorpusQualityAssurance

public CorpusQualityAssurance()
Method Detail

init

public Resource init()
Description copied from class: AbstractVisualResource
Initialise this resource, and return it.

Specified by:
init in interface Resource
Overrides:
init in class AbstractVisualResource

initLocalData

protected void initLocalData()

initGuiComponents

protected void initGuiComponents()

initListeners

protected void initListeners()

createToolTipFromColumnName

protected String createToolTipFromColumnName(String columnName)
Create a table header tool tips from the column name.

Parameters:
columnName - name used for creating the tooltip
Returns:
tooltip value

cleanup

public void cleanup()
Description copied from class: AbstractVisualResource
Does nothing now, but meant to clear all internal data

Specified by:
cleanup in interface Resource
Overrides:
cleanup in class AbstractVisualResource

setTarget

public void setTarget(Object target)
Description copied from class: AbstractVisualResource
Called by the GUI when this viewer/editor has to initialise itself for a specific object.

Specified by:
setTarget in interface VisualResource
Overrides:
setTarget in class AbstractVisualResource
Parameters:
target - the object (be it a Resource, DataStore or whatever) this viewer has to display

documentAdded

public void documentAdded(CorpusEvent e)
Description copied from interface: CorpusListener
Called when a document has been added

Specified by:
documentAdded in interface CorpusListener

documentRemoved

public void documentRemoved(CorpusEvent e)
Description copied from interface: CorpusListener
Called when a document has been removed

Specified by:
documentRemoved in interface CorpusListener

readSetsTypesFeatures

protected void readSetsTypesFeatures(int documentStart)
Update set lists.

Parameters:
documentStart - first document to read in the corpus, the first document of the corpus is 0.

updateSetList

protected void updateSetList()

compareAnnotation

protected void compareAnnotation()

printSummary

protected void printSummary(Object measureObject,
                            DefaultTableModel tableModel,
                            int columnGroupSize,
                            int insertionRow,
                            Object[] measures)