{"record":{"id":"70c577e5a8d22e3b","repo":"stanfordnlp/CoreNLP","slug":"failed-to-get-attributes-from","errorCode":null,"errorMessage":"Failed to get attributes from ","messagePattern":"Failed to get attributes from ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/edu/stanford/nlp/time/TimeExpressionExtractorImpl.java","lineNumber":151,"sourceCode":"        String origText = annotation.get(CoreAnnotations.TextAnnotation.class);\n        String text = cm.get(CoreAnnotations.TextAnnotation.class);\n        if (origText != null) {\n          // Make sure the text is from original (and not from concatenated tokens)\n          ChunkAnnotationUtils.annotateChunkText(cm, annotation);\n          text = cm.get(CoreAnnotations.TextAnnotation.class);\n        }\n        Map<String,String> timexAttributes;\n        try {\n          timexAttributes = temporal.getTimexAttributes(timeIndex);\n          if (options.includeRange) {\n            SUTime.Temporal rangeTemporal = temporal.getRange();\n            if (rangeTemporal != null) {\n              timexAttributes.put(\"range\", rangeTemporal.toString());\n            }\n          }\n        } catch (Exception e) {\n          if (options.verbose) {\n            logger.warn(\"Failed to get attributes from \" + text + \", timeIndex \" + timeIndex);\n            logger.warn(e);\n          }\n          continue;\n        }\n        Timex timex;\n        try {\n          timex = Timex.fromMap(text, timexAttributes);\n        } catch (Exception e) {\n          if (options.verbose) {\n            logger.warn(\"Failed to process timex \" + text + \" with attributes \" + timexAttributes);\n            logger.warn(e);\n          }\n          continue;\n        }\n        assert timex != null;  // Timex.fromMap never returns null and if it exceptions, we've already done a continue\n        cm.set(TimeAnnotations.TimexAnnotation.class, timex);\n        coreMaps.add(cm);\n      }","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/time/TimeExpressionExtractorImpl.java#L133-L169","documentation":"This is not a thrown exception but a logged warning in SUTime's toCoreMaps: when converting a matched time expression into CoreMap attributes, any Exception thrown by the attribute-building code is caught and, if options.verbose is on, logged as 'Failed to get attributes from <text>, timeIndex <n>'. The offending time expression is then skipped (continue), so the token range simply gets no Timex annotation. It signals the SUTime rules produced a temporal expression whose attributes could not be computed.","triggerScenarios":"Running TimeExpressionExtractorImpl.extractTimeExpressionCoreMaps (e.g. via annotator 'sutime' in StanfordCoreNLP) when the per-expression attribute extraction throws — for instance a rule-generated temporal whose toCoreMaps conversion fails on unexpected input, or NumberNormalizer/parsing edge cases inside the matched expression.","commonSituations":"Unusual date/time text in corpora (malformed dates, partial times), custom SUTime rule files (defs.xml / sutime rules) with buggy expressions, or running with options.verbose=true while annotating noisy text; users notice missing TIMEX3 tags on some tokens rather than a crash.","solutions":["Enable options.verbose (or read the logged exception) to see the underlying exception and the offending text","Fix or remove the problematic SUTime rule in your rules/defs files that produces the malformed temporal","Update to a newer Stanford CoreNLP version; many SUTime parsing edge cases have been patched","If the text is known-bad, pre-clean or skip those segments; the extractor already continues past them"],"exampleFix":"// before\nProperties props = new Properties();\nprops.setProperty(\"annotators\", \"tokenize,ssplit,pos,lemma,ner\");\n// verbose off hides the root cause\n// after\nprops.setProperty(\"annotators\", \"tokenize,ssplit,pos,lemma,ner\");\nprops.setProperty(\"sutime.verbose\", \"true\"); // surface the underlying exception\n// then fix/patch the SUTime rule identified by the logged stack trace","handlingStrategy":"validation","validationCode":"// ensure options.verbose is on during development so failures are visible\nProperties props = new Properties();\nprops.setProperty(\"sutime.verbose\", \"true\");\n// and pre-check that your input text is well-formed for temporal parsing\nboolean sane = text != null && !text.isEmpty() && text.length() < 10_000;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep sutime.verbose=true in dev/CI over your corpus to surface skipped expressions","Pin and update CoreNLP versions deliberately; test SUTime output on representative text","Avoid custom SUTime rules unless tested against edge-case dates"],"tags":["java","nlp","sutime","temporal-annotation"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}