|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.time.TimeAnnotator
public class TimeAnnotator
Annotate temporal expressions with SUTime.
The expressions recognized by SUTime are loosely based on GUTIME.
After annotation, the TimeAnnotations.TimexAnnotations annotation
will be populated with a List<CoreMap>, each of which
will represent one temporal expression.
If a reference time is set (via CoreAnnotations.DocDateAnnotation),
then temporal expressions are resolved with respect the to document date.
Input annotations
| Annotation | Type | Description | Required? |
|---|---|---|---|
CoreAnnotations.DocDateAnnotation |
String |
If present, then the string is interpreted as a date/time and used as the reference document date with respect to which other temporal expressions are resolved | Optional |
CoreAnnotations.SentencesAnnotation |
List<CoreMap> |
If present, time expressions will be extracted from each sentence and each sentence will be annotated individually. | Optional (good to have) |
CoreAnnotations.TokensAnnotation |
List<CoreLabel> |
Tokens (for each sentence or for entire annotation if no sentences) | Required |
CoreAnnotations.TextAnnotation |
String |
Text (for each sentence or for entire annotation if no sentences) | Optional |
CoreAnnotations.TextAnnotation |
String |
Token text (normalized) | Required |
CoreAnnotations.OriginalTextAnnotation |
String |
Token text (original) | Required |
CoreAnnotations.CharacterOffsetBeginAnnotation |
Integer |
The index of the first character of this token (0-based wrt to TextAnnotation of the annotation containing the TokensAnnotation). | Required |
CoreAnnotations.CharacterOffsetEndAnnotation |
Integer |
The index of the first character after this token (0-based wrt to TextAnnotation of the annotation containing the TokensAnnotation). | Required |
CoreAnnotations.PartOfSpeechAnnotation |
String |
Token part of speech | Optional |
Output annotations
| Annotation | Type | Description |
|---|---|---|
TimeAnnotations.TimexAnnotations |
List<CoreMap> |
List of temporal expressions (on the entire annotation and also for each sentence) |
TimeAnnotations.TimexAnnotation |
Timex |
Timex object with TIMEX3 XML attributes, use for exporting TIMEX3 information |
TimeExpression.Annotation |
TimeExpression |
TimeExpression object. Use getTemporal() to get internal temporal representation. |
TimeExpression.ChildrenAnnotation |
List<CoreMap> |
List of chunks forming this time expression (inner chunks can be tokens, nested time expressions, numeric expressions, etc) |
CoreAnnotations.TextAnnotation |
String |
Text of this time expression |
CoreAnnotations.TokensAnnotation |
List<CoreLabel> |
Tokens that make up this time expression |
CoreAnnotations.CharacterOffsetBeginAnnotation |
Integer |
The index of the first character of this token (0-based). |
CoreAnnotations.CharacterOffsetEndAnnotation |
Integer |
The index of the first character after this token (0-based). |
CoreAnnotations.TokenBeginAnnotation |
Integer |
The index of the first token of this time expression (0-based). |
CoreAnnotations.TokenEndAnnotation |
Integer |
The index of the first token after this time expression (0-based). |
| Constructor Summary | |
|---|---|
TimeAnnotator()
|
|
TimeAnnotator(java.lang.String name,
java.util.Properties props)
|
|
| Method Summary | |
|---|---|
void |
annotate(Annotation annotation)
|
java.util.List<CoreMap> |
annotateSingleSentence(CoreMap sentence,
java.lang.String docDate,
SUTime.TimeIndex timeIndex)
Helper method for people not working from a complete Annotation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TimeAnnotator()
public TimeAnnotator(java.lang.String name,
java.util.Properties props)
| Method Detail |
|---|
public void annotate(Annotation annotation)
annotate in interface Annotator
public java.util.List<CoreMap> annotateSingleSentence(CoreMap sentence,
java.lang.String docDate,
SUTime.TimeIndex timeIndex)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||