Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15105#discussion_r79158292
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala 
---
    @@ -227,7 +227,7 @@ class Word2VecModel private[ml] (
        */
       @Since("1.5.0")
       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 
IMHO.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to