Skip to content

Commit

Permalink
get raw vectors for further processing in Word2Vec
Browse files Browse the repository at this point in the history
e.g. clustering

Author: tkaessmann <tobias.kaessmann@s24.com>

Closes apache#3309 from tkaessmann/branch-1.2 and squashes the following commits:

e3a3142 [tkaessmann] changes the comment for getVectors
58d3d83 [tkaessmann] removes sign from comment
a5be213 [tkaessmann] fixes getVectors to fit code guidelines
3782fa9 [tkaessmann] get raw vectors for further processing
  • Loading branch information
tkaessmann authored and mengxr committed Nov 25, 2014
1 parent 90a6a46 commit 6c666b4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,4 +461,11 @@ class Word2VecModel private[mllib] (
.tail
.toArray
}

/**
* Returns a map of words to their vector representations.
*/
def getVectors: Map[String, Array[Float]] = {
model
}
}

0 comments on commit 6c666b4

Please sign in to comment.