public final FeatureVector next() throws IOException
    {

        final String line = reader.readLine();

        if (line == null)
        {
            return null;
        }

        final StringTokenizer tokenizer = new StringTokenizer(line, " \t");

        // If there is no label encoder, then just absorb this value
        String strLabel = tokenizer.nextToken();
        Integer label;
        if (labelEncoder == null)
        {
            label = Integer.valueOf(strLabel);
        }
        else // Use the label encoder
        {
            label = labelEncoder.indexOf(strLabel);
            if (label == null)
            {
                return next();
            }
            // This is due to the zero offset assigned by the lazy encoder, we want 1-based
            label++;
        }

        // Parse a sentence and place results in a continuous Bag of Words
        DenseVectorN x = new DenseVectorN((int)embeddingSize);
        ArrayDouble xArray = x.getX();
        while (tokenizer.hasMoreTokens())
        {
            String word = tokenizer.nextToken().toLowerCase();

            float[] wordVector = word2vecModel.getVec(word);
            for (int j = 0, sz = xArray.size(); j < sz; ++j)
            {
                float fj = wordVector[j];
                boolean hadNaN = false;
                if (Float.isNaN(fj))
                {
                    hadNaN = true;
                    fj = 0;
                    //throw new IOException("Unexpected NaN");
                }
                if (hadNaN)
                {
                    System.err.println("NaN word: " + word);
                }
                xArray.addi(j, fj);
            }
        }

        final FeatureVector fv = new FeatureVector(label, x);
        fv.getX().organize();
        return fv;
    }