Skip to content

Commit

Permalink
Added outputAnnotationName to be set by user also.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkourdis committed Sep 17, 2017
1 parent e4a7bbc commit 7f0c692
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ The following libraries should be placed inside the $GATE_HOME/lib directory:

The following runtime parameters are available:

`inputAnnotationSetName`: The name of the annotation set that has the annotation with the date to be used as reference (if `referenceDate`=annotation).
`inputAnnotationSetName`: Name of the annotation set that has the annotation with the date to be used as reference (if `referenceDate`=annotation).

`inputAnnotationName`: The name of the annotation that has the date to be used as reference (if `referenceDate`=annotation).
`inputAnnotationName`: Name of the annotation that has the date to be used as reference (if `referenceDate`=annotation).

`inputFeatureName`: The name of the feature with value the date to be used as reference (if `referenceDate`=annotation).
`inputFeatureName`: Name of the feature with value the date to be used as reference (if `referenceDate`=annotation). Date should be in "yyy-MM-dd" format.

`outputASName`: Name of the annotation set to write the TIMEX3 annotations (default value "SUTime").

`referenceDate`: A date set by the user as reference for normalizing temporal expressions. Permissible values are:
`outputASName`: Name of the annotation set to write the results. Default value is SUTime.

`outputAnnotationName`: Name of the annotation to write the results. Default value is TIMEX3.

`referenceDate`: Date set by the user as reference for normalizing temporal expressions. Permissible values are:

| Value | Description |
| ----- | ----------- |
Expand All @@ -51,17 +53,19 @@ User should verify that file dates are supported by the operating system.

## 4. Example

Screenshot of runtime parameters selection:
Sample screenshots from GATE Developer:

##### Runtime parameters window

![Screenshot](https://user-images.githubusercontent.com/11142121/30517970-dcba19ba-9b24-11e7-8890-c80b5bd676e4.png)
![Screenshot](https://user-images.githubusercontent.com/11142121/30518264-99484798-9b2d-11e7-8371-9ccde708a932.png)

Screenshot from GATE Developer:
##### Document annotated with TIME3X tags

![Screenshot](https://user-images.githubusercontent.com/11142121/30256611-ef21e2e0-9660-11e7-9d02-8de678894b1a.png)

## 5. Release History

* **Version 0.3 - September 16, 2017**: Reference date can also be retrieved from a document annotation.
* **Version 0.4 - September 16, 2017**: Reference date can also be retrieved from a document annotation.
* **Version 0.3 - September 12, 2017**: Improve reference date handling.
* **Version 0.2 - September 10, 2017**: Minor corrections to initial version.
* **Version 0.1 - September 10, 2017**: Initial working version.
31 changes: 22 additions & 9 deletions src/main/java/gate/creole/stanfordcorenlp/TemporalTagger.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,17 @@ public class TemporalTagger extends AbstractLanguageAnalyser implements Processi
private static final String dateFormat = "yyyy-MM-dd"; //date format required by SUTime
private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateFormat);
private String inputAnnotationSetName; //name of the annotation set to be used for input
private String inputAnnotationName; // name of the annotation to be used for input
private String inputFeatureName; // name of the feature to be used for input (i.e. holds the reference date)
private String outputAnnotationSetName; //name of the annotation set to be used for output (i.e. write the TIME3X tags)
private String inputAnnotationName; //name of the annotation to be used for input
private String inputFeatureName; //name of the feature to be used for input
private String outputAnnotationSetName; //name of the annotation set to write the results
private String outputAnnotationName; //name of the annotation set to write the results
private String referenceDate; //reference date to be used for normalization
private String fileDate; //file date to be retrieved from the operating system
private AnnotationPipeline annotationPipeline; //Stanford CoreNLP annotation pipeline

@RunTime
@Optional
@CreoleParameter(comment = "The name of the annotation set that has the annotation with the date to be used as reference", defaultValue = "")
@CreoleParameter(comment = "Name of the annotation set that has the annotation with the date to be used as reference (if `referenceDate`=annotation)", defaultValue = "")
public void setInputAnnotationSetName(String name) {
inputAnnotationSetName = name;
}
Expand All @@ -76,7 +77,7 @@ public String getInputAnnotationSetName() {

@RunTime
@Optional
@CreoleParameter(comment = "The name of the annotation that has the date to be used as reference.", defaultValue = "")
@CreoleParameter(comment = "Name of the annotation that has the date to be used as reference (if `referenceDate`=annotation).", defaultValue = "")
public void setInputAnnotationName(String name) { inputAnnotationName = name;}

/**
Expand All @@ -88,19 +89,19 @@ public String getInputAnnotationSetName() {

@RunTime
@Optional
@CreoleParameter(comment = "The name of the feature with value the date to be used as reference.", defaultValue = "")
@CreoleParameter(comment = "Name of the feature with value the date to be used as reference (if `referenceDate`=annotation). Date should be in \"yyy-MM-dd\" format.", defaultValue = "")
public void setInputFeatureName(String name) { inputFeatureName = name;}

/**
* Provides the name of the feature holding the date to be used as reference date.
* Provides the name of the feature holding the date to be used as reference date. Date should be in "yyy-MM-dd" format.
*
* @return The name of the feature with the document date.
*/
public String getInputFeatureName() {return inputFeatureName; }

@RunTime
@Optional
@CreoleParameter(comment = "The annotation set to be used for output.", defaultValue = "SUTime")
@CreoleParameter(comment = "Name of the annotation set to write the results.", defaultValue = "SUTime")
public void setOutputAnnotationSetName(String name) {
outputAnnotationSetName = name;
}
Expand All @@ -114,10 +115,22 @@ public String getOutputAnnotationSetName() {
return outputAnnotationSetName;
}

@RunTime
@Optional
@CreoleParameter(comment = "Name of the annotation to write the results.", defaultValue = "TIMEX3")
public void setOutputAnnotationName(String name) { outputAnnotationName = name;}

/**
* Provides the name of the output annotation to write the results.
*
* @return The name of the annotation used for output.
*/
public String getOutputAnnotationName() {return outputAnnotationName; }

@RunTime
@Optional
@CreoleParameter(comment = "Reference date of the document. Permissible date values are 'yyyy-MM-dd', " +
"annotation (feature of annotation holding the date)" +
"annotation (document annotation holding the date)" +
"'today' (today's date), 'creationDate' (date file was created), " +
"'lastAccessDate' (date file was last accessed) and 'lastModifiedDate' (date file was last modified).",
defaultValue = "today")
Expand Down

0 comments on commit 7f0c692

Please sign in to comment.