How to set the labels while using TfIdfVectorizer ?
After building a TfIdfVectorizer i am trying to use the vectorize method and it is throwing a null pointer exception — Cannot invoke “java.util.List.indexOf(Object)” because “this.labels” is null
the code snippet :
DataSet.merge(Files.lines(dataFile.toPath()) .filter(x->!x.isBlank() && x.split("\\s+").length>3) .map(this::splitString) .map(x->tfidf.vectorize(x,x))
// —passing 2 strings in the vectorize method - exception is being throw here
the field labelsSource seem to be a protected field inside the static class Builder and i dont seem to have any control on it , is there any other way to do this .