gate.qa
Class QualityAssurancePR

java.lang.Object
  extended by gate.util.AbstractFeatureBearer
      extended by gate.creole.AbstractResource
          extended by gate.creole.AbstractProcessingResource
              extended by gate.creole.AbstractLanguageAnalyser
                  extended by gate.qa.QualityAssurancePR
All Implemented Interfaces:
ANNIEConstants, Executable, LanguageAnalyser, ProcessingResource, Resource, FeatureBearer, NameBearer, Serializable

@CreoleResource(name="Quality Assurance PR",
                comment="The Quality Assurance PR provides a functionality of the Corpus QA Tool in GATE Developer")
public class QualityAssurancePR
extends AbstractLanguageAnalyser
implements ProcessingResource

This PR has the same functionality as the Quality Assurance GUI. If added to a corpus pipeline, it executes on the very last document - making sure that the statistics are calculated on the entire corpus. User can provide various run-time parameters to configure the PR. One of the parameters is the output directory where the results are stored. The PR produces two main files - one for the corpus statistics and one for the documents statistics. In case of the latter, each document in the output file is linked with the output of annotationDiff utility containing annotation by annotation comparison for every annotation type specified in annotationTypes parameter.

Author:
niraj
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class gate.creole.AbstractProcessingResource
AbstractProcessingResource.InternalStatusListener, AbstractProcessingResource.IntervalProgressListener
 
Field Summary
protected  NumberFormat f
          number formatter
 
Fields inherited from class gate.creole.AbstractLanguageAnalyser
corpus, document
 
Fields inherited from class gate.creole.AbstractProcessingResource
interrupted
 
Fields inherited from class gate.creole.AbstractResource
name
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Fields inherited from interface gate.creole.ANNIEConstants
ANNOTATION_COREF_FEATURE_NAME, DATE_ANNOTATION_TYPE, DATE_POSTED_ANNOTATION_TYPE, DEFAULT_FILE, DOCUMENT_COREF_FEATURE_NAME, JOB_ID_ANNOTATION_TYPE, LOCATION_ANNOTATION_TYPE, LOOKUP_ANNOTATION_TYPE, LOOKUP_CLASS_FEATURE_NAME, LOOKUP_INSTANCE_FEATURE_NAME, LOOKUP_LANGUAGE_FEATURE_NAME, LOOKUP_MAJOR_TYPE_FEATURE_NAME, LOOKUP_MINOR_TYPE_FEATURE_NAME, LOOKUP_ONTOLOGY_FEATURE_NAME, MONEY_ANNOTATION_TYPE, ORGANIZATION_ANNOTATION_TYPE, PERSON_ANNOTATION_TYPE, PERSON_GENDER_FEATURE_NAME, PLUGIN_DIR, PR_NAMES, SENTENCE_ANNOTATION_TYPE, SPACE_TOKEN_ANNOTATION_TYPE, TOKEN_ANNOTATION_TYPE, TOKEN_CATEGORY_FEATURE_NAME, TOKEN_KIND_FEATURE_NAME, TOKEN_LENGTH_FEATURE_NAME, TOKEN_ORTH_FEATURE_NAME, TOKEN_STRING_FEATURE_NAME
 
Constructor Summary
QualityAssurancePR()
           
 
Method Summary
 void execute()
          The execute method
 List<String> getAnnotationTypes()
          Annotation types for which the stats should be calculated
protected  File getDiffResultsExportFile(String documentName)
          Generates a file name to export annotation diff results to.
 List<String> getFeatureNames()
          Features names for which the stats should be calculated
 String getKeyASName()
          Returns the key annotation set name provided by the user
 Measure getMeasure()
          Measure to use for stats calculation
 URL getOutputFolderUrl()
          URL of the folder to store output files into
 String getResponseASName()
          Returns the response annotation set name provided by the user
 Resource init()
          Initialise this resource, and return it.
 void setAnnotationTypes(List<String> annotationTypes)
          Annotation types for which the stats should be calculated
 void setFeatureNames(List<String> featureNames)
          Features names for which the stats should be calculated
 void setKeyASName(String keyASName)
          Sets the key annotation set name
 void setMeasure(Measure measure)
          Measure to use for stats calculation
 void setOutputFolderUrl(URL outputFolderUrl)
          URL of the folder to store output files into
 void setResponseASName(String responseASName)
          sets the response annotation set name
 
Methods inherited from class gate.creole.AbstractLanguageAnalyser
getCorpus, getDocument, setCorpus, setDocument
 
Methods inherited from class gate.creole.AbstractProcessingResource
addProgressListener, addStatusListener, cleanup, fireProcessFinished, fireProgressChanged, fireStatusChanged, getRuntimeParameterValues, getRuntimeParameterValues, interrupt, isInterrupted, reInit, removeProgressListener, removeStatusListener
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, flushBeanInfoCache, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.ProcessingResource
reInit
 
Methods inherited from interface gate.Resource
cleanup, getParameterValue, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 
Methods inherited from interface gate.Executable
interrupt, isInterrupted
 

Field Detail

f

protected NumberFormat f
number formatter

Constructor Detail

QualityAssurancePR

public QualityAssurancePR()
Method Detail

init

public Resource init()
              throws ResourceInstantiationException
Initialise this resource, and return it.

Specified by:
init in interface Resource
Overrides:
init in class AbstractProcessingResource
Throws:
ResourceInstantiationException

execute

public void execute()
             throws ExecutionException
The execute method

Specified by:
execute in interface Executable
Overrides:
execute in class AbstractProcessingResource
Throws:
ExecutionException

getDiffResultsExportFile

protected File getDiffResultsExportFile(String documentName)
Generates a file name to export annotation diff results to.

Returns:

getKeyASName

public String getKeyASName()
Returns the key annotation set name provided by the user

Returns:

setKeyASName

@RunTime
@Optional
@CreoleParameter(defaultValue="Key")
public void setKeyASName(String keyASName)
Sets the key annotation set name

Parameters:
keyASName -

getResponseASName

public String getResponseASName()
Returns the response annotation set name provided by the user

Returns:

setResponseASName

@Optional
@RunTime
@CreoleParameter(defaultValue="")
public void setResponseASName(String responseASName)
sets the response annotation set name

Parameters:
responseASName -

getAnnotationTypes

public List<String> getAnnotationTypes()
Annotation types for which the stats should be calculated

Returns:

setAnnotationTypes

@RunTime
@CreoleParameter
public void setAnnotationTypes(List<String> annotationTypes)
Annotation types for which the stats should be calculated

Parameters:
annotationTypes -

getFeatureNames

public List<String> getFeatureNames()
Features names for which the stats should be calculated

Returns:

setFeatureNames

@RunTime
@Optional
@CreoleParameter
public void setFeatureNames(List<String> featureNames)
Features names for which the stats should be calculated

Parameters:
featureNames -

getMeasure

public Measure getMeasure()
Measure to use for stats calculation

Returns:

setMeasure

@RunTime
@CreoleParameter
public void setMeasure(Measure measure)
Measure to use for stats calculation

Parameters:
measure -

getOutputFolderUrl

public URL getOutputFolderUrl()
URL of the folder to store output files into

Returns:

setOutputFolderUrl

@RunTime
@CreoleParameter(suffixes="html")
public void setOutputFolderUrl(URL outputFolderUrl)
URL of the folder to store output files into

Parameters:
outputFolderUrl -