Github user srowen commented on a diff in the pull request:
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala 
    @@ -227,7 +227,7 @@ class Word2VecModel private[ml] (
       def findSynonyms(word: String, num: Int): DataFrame = {
    -    findSynonyms(wordVectors.transform(word), num)
    +    findSynonyms(wordVectors.transform(word), num, Some(word))
    --- End diff --
    I see. I agree that something gets a little bit duplicated no matter what. 
Given your change, it seems easiest to pass the string vs vector argument all 
the way down, even if that means in these other two classes you duplicate a 
little code to transform the dataframe, etc. If it's nontrivial, sure, a little 
helper method seems reasonable. That would help keep this layered more cleanly 

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to