Annotate temporal expressions in text with {@link SUTime}. The expressions recognized by SUTime are loosely based on GUTIME. After annotation, the {@link TimeAnnotations.TimexAnnotations} annotationwill be populated with a
, each of which will represent one temporal expression. If a reference time is set (via {@link edu.stanford.nlp.ling.CoreAnnotations.DocDateAnnotation}), then temporal expressions are resolved with respect to the document date. You set it on an Annotation as follows:
Annotation | Type | Description | Required? |
{@link edu.stanford.nlp.ling.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 |
{@link edu.stanford.nlp.ling.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) |
{@link edu.stanford.nlp.ling.CoreAnnotations.TokensAnnotation} | List<CoreLabel> | Tokens (for each sentence or for entire annotation if no sentences) | Required |
{@link edu.stanford.nlp.ling.CoreAnnotations.TextAnnotation} | String | Text (for each sentence or for entire annotation if no sentences) | Optional |
Per token annotations |
{@link edu.stanford.nlp.ling.CoreAnnotations.TextAnnotation} | String | Token text (normalized) | Required |
{@link edu.stanford.nlp.ling.CoreAnnotations.OriginalTextAnnotation} | String | Token text (original) | Required |
{@link edu.stanford.nlp.ling.CoreAnnotations.CharacterOffsetBeginAnnotation} | Integer | The index of the first character of this token (0-based wrt to TextAnnotation of the annotation containing the TokensAnnotation). | Required |
{@link edu.stanford.nlp.ling.CoreAnnotations.CharacterOffsetEndAnnotation} | Integer | The index of the first character after this token (0-based wrt to TextAnnotation of the annotation containing the TokensAnnotation). | Required |
{@link edu.stanford.nlp.ling.CoreAnnotations.PartOfSpeechAnnotation} | String | Token part of speech | Optional |
Annotation | Type | Description |
{@link TimeAnnotations.TimexAnnotations} | List<CoreMap> | List of temporal expressions (on the entire annotation and also for each sentence) |
Per each temporal expression |
{@link TimeAnnotations.TimexAnnotation} | {@link Timex} | Timex object with TIMEX3 XML attributes, use for exporting TIMEX3 information |
{@link TimeExpression.Annotation} | {@link TimeExpression} | TimeExpression object. Use getTemporal() to get internal temporal representation. |
{@link TimeExpression.ChildrenAnnotation} | List<CoreMap> | List of chunks forming this time expression (inner chunks can be tokens, nested time expressions, numeric expressions, etc) |
{@link edu.stanford.nlp.ling.CoreAnnotations.TextAnnotation} | String | Text of this time expression |
{@link edu.stanford.nlp.ling.CoreAnnotations.TokensAnnotation} | List<CoreLabel> | Tokens that make up this time expression |
{@link edu.stanford.nlp.ling.CoreAnnotations.CharacterOffsetBeginAnnotation} | Integer | The index of the first character of this token (0-based). |
{@link edu.stanford.nlp.ling.CoreAnnotations.CharacterOffsetEndAnnotation} | Integer | The index of the first character after this token (0-based). |
{@link edu.stanford.nlp.ling.CoreAnnotations.TokenBeginAnnotation} | Integer | The index of the first token of this time expression (0-based). |
{@link edu.stanford.nlp.ling.CoreAnnotations.TokenEndAnnotation} | Integer | The index of the first token after this time expression (0-based). |