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

    https://github.com/apache/spark/pull/6228#discussion_r30486666
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala ---
    @@ -410,6 +410,9 @@ class Word2Vec extends Serializable with Logging {
           i += 1
         }
     
    +    require(word2VecMap.size > 0, "The word2vec map should not be empty. 
You may need to check " +
    --- End diff --
    
    This should be checked by the `vocabSize`, but actually it doesn't. You are 
right, I think the check should be added in this line 
https://github.com/yinxusen/spark/blob/SPARK-7663/mllib/src/main/scala/org/apache/spark/mllib/feature/Word2Vec.scala#L160
 to prevent the following computations.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to