You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2024/12/26 08:11:45 UTC

[PR] [SPARK-50673][ML] Avoid traversing model coefficients twice in `Word2VecModel` constructor [spark]

zhengruifeng opened a new pull request, #49298:
URL: https://github.com/apache/spark/pull/49298

   ### What changes were proposed in this pull request?
   Avoid traversing model twice in `Word2VecModel` constructor
   
   
   ### Why are the changes needed?
   In public constructor `def this(model: Map[String, Array[Float]])`,
   the implementation traverses the model coefficients (which is a Map) twice to build the `Word2VecModel`, for `wordIndex` and `wordVectors`, respectively.
   
   I am not sure whether it might be problematic, since the two traversals needs the same ordering. 
   
   Generating the result with single pass can guarantee the correctness, anyway.
   
   
   ### Does this PR introduce _any_ user-facing change?
   no
   
   
   ### How was this patch tested?
   existing tests
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   no


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-50673][ML] Avoid traversing model coefficients twice in `Word2VecModel` constructor [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #49298: [SPARK-50673][ML] Avoid traversing model coefficients twice in `Word2VecModel` constructor
URL: https://github.com/apache/spark/pull/49298


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-50673][ML] Avoid traversing model coefficients twice in `Word2VecModel` constructor [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #49298:
URL: https://github.com/apache/spark/pull/49298#issuecomment-2563194539

   thanks, merged to master


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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