Labels for TfIdfVectorizer

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 :

            .filter(x->!x.isBlank() && x.split("\\s+").length>3)

// —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 .