{"record":{"id":"a1ae4193fc9d9721","repo":"stanfordnlp/CoreNLP","slug":"couldn-t-load-word-vectors","errorCode":null,"errorMessage":"Couldn't load word vectors","messagePattern":"Couldn't load word vectors","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/classify/ColumnDataClassifier.java","lineNumber":1561,"sourceCode":"      for (String line; (line = br.readLine()) != null; ) {\n        String[] fields = line.split(\"\\\\s+\");\n        if (numDimensions < 0) {\n          numDimensions = fields.length - 1;\n        } else {\n          if (numDimensions != fields.length -1 && ! warned) {\n            logger.info(\"loadWordVectors: Inconsistent vector size: \" + numDimensions +\n                    \" vs. \" + (fields.length - 1));\n            warned = true;\n          }\n        }\n        float[] vector = new float[fields.length - 1];\n        for (int i = 1; i < fields.length; i++) {\n          vector[i-1] = Float.parseFloat(fields[i]);\n        }\n        map.put(fields[0], vector);\n      }\n    } catch (IOException ioe) {\n      throw new RuntimeIOException(\"Couldn't load word vectors\", ioe);\n    }\n    timing.done(\"Loading word vectors from \" + filename + \" ... \");\n    return map;\n  }\n\n\n  /**\n   * Initialize using values in Properties file.\n   *\n   * @param props Properties, with the special format of column.flag used in ColumnDataClassifier\n   * @return An array of flags for each data column, with additional global flags in element [0]\n   */\n  private static Pair<Flags[], Classifier<String,String>> setProperties(Properties props) {\n    Flags[] myFlags;\n    Classifier<String,String> classifier = null;\n    boolean myUsesRealValues = false;\n\n    Pattern prefix;","sourceCodeStart":1543,"sourceCodeEnd":1579,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/classify/ColumnDataClassifier.java#L1543-L1579","documentation":"Thrown in ColumnDataClassifier.loadWordVectors when the word-vector file given via -wordVector cannot be opened or parsed (unreadable path, wrong format, or missing file). It signals that pretrained embedding initialization cannot proceed.","triggerScenarios":"Thrown at src/edu/stanford/nlp/classify/ColumnDataClassifier.java:1561 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the word vector file path is correct and the file exists and is readable","Use a supported vector format (e.g., GloVe text format with word followed by floats)","Check the classpath/working directory if using a relative path","Download the intended embedding file if it is missing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}