stanfordnlp/CoreNLP · error · RuntimeException

Error processing :Unknown attribute : from line

Error message

Error processing ${attrsFile}:Unknown attribute ${attrname}: from line ${line}

What it means

SUTimeMain, when loading an attribute file describing TimeBank/TEMPEVAL timex attributes, encounters an attribute name it does not recognize and aborts with a RuntimeException naming the file, the attribute, and the line. It indicates the attrs file contains a key outside the supported set (id, type, value, etc.), or the file is from an incompatible corpus version.

Solutions

  1. Open attrsFile at the reported line and remove or rename the unknown attribute to one the tool supports (id, type, value, ...)
  2. Verify the attrs file matches the corpus version expected by your CoreNLP version
  3. Update CoreNLP to a version whose SUTimeMain knows the newer attribute names
  4. Patch/extend the switch in SUTimeMain to handle the new attribute and re-run

Example fix

// before (line 42 of attrs file)
unknownattr=X
// after
value=X
Defensive patterns

Strategy: validation

Validate before calling

Set<String> known = Set.of("id","type","value","start","end");
for (String attr : readAttrNames(attrsFile)) { if (!known.contains(attr)) throw new IllegalStateException("Unknown attribute: " + attr); }

Try / catch

try { timexMap = loadAttrs(attrsFile); } catch (RuntimeException e) { /* parse message for file/line, sanitize the attrs file, retry */ }

Prevention

When it happens

Trigger: Running SUTimeMain in TEMPEVAL2/TEMPEVAL3 or TIMEBANK_CSV mode with a -attrs / attribute mapping file containing an attribute name not handled by the parser's switch statement, at the reported line.

Common situations: Using attribute files from a newer/different corpus release, hand-edited attr files with typos, or files with extra columns/keys the tool was never taught to read.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/9c0a304d4ef48a4d. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/time/SUTimeMain.java:706

      String attrname = fields[6];
      String attrvalue = fields[7];

      // Find entry
      TimexAttributes timex = findTimex(timexMap, docName, tid);
      assert(timex.sentIndex == sentNo);
      assert(timex.tokenStart <= tokenNo && timex.tokenEnd > tokenNo);

      switch (attrname) {
        case "type":
          assert (timex.type == null || timex.type.equals(attrvalue));
          timex.type = attrvalue;
          break;
        case "value":
          assert (timex.value == null || timex.value.equals(attrvalue));
          timex.value = attrvalue;
          break;
        default:
          throw new RuntimeException("Error processing " + attrsFile + ":" +
              "Unknown attribute " + attrname + ": from line " + line);
      }
    }
    attrBr.close();
    return timexMap;
  }

  public static void processTempEval2Tab(AnnotationPipeline pipeline, String in, String out, Map<String,String> docDates) throws IOException
  {
    Map<String,List<TimexAttributes>> timexMap = readTimexAttrExts(in  + "/timex-extents.tab", in  + "/timex-attributes.tab");
    BufferedReader br = IOUtils.readerFromString(in  + "/base-segmentation.tab");
    PrintWriter debugPw = IOUtils.getPrintWriter(out + "/timex-debug.out");
    PrintWriter attrPw = IOUtils.getPrintWriter(out + "/timex-attrs.res.tab");
    PrintWriter extPw = IOUtils.getPrintWriter(out + "/timex-extents.res.tab");
    PrintWriter attrDebugPwGold = IOUtils.getPrintWriter(out + "/timex-attrs.debug.gold.tab");
    PrintWriter attrDebugPw = IOUtils.getPrintWriter(out + "/timex-attrs.debug.res.tab");
    String line;
    String curDocName = null;

View on GitHub (pinned to 1b7edd19c4)