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

    https://github.com/apache/spark/pull/7263#discussion_r34094649
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/feature/Word2Vec.scala 
---
    @@ -146,6 +151,55 @@ class Word2VecModel private[ml] (
         wordVectors: feature.Word2VecModel)
       extends Model[Word2VecModel] with Word2VecBase {
     
    +
    +  /**
    +   * Return a map of every word to its Vector representation.
    +   */
    +  val getVectors: Map[String, Array[Float]] = wordVectors.getVectors
    --- End diff --
    
    So its my understanding, from my reading of the code, it isn't possible to 
access the Spark context here. If we look at similar methods in other models 
(like predict in classifier), they can't access the Spark Context, its only 
when we are applying fit/transform and we have a dataframe passed into us that 
we can access the SparkContext.


---
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