On 9/7/15 11:08 PM,
sunilchi...@gmail.com wrote:
> On Monday, September 7, 2015 at 11:14:58 PM UTC+5:30, Michal Malohlava wrote:
>> On 9/6/15 11:36 PM,
sunilchi...@gmail.com wrote:
>>> On Wednesday, June 17, 2015 at 8:14:55 PM UTC+5:30, Julian Hillebrand wrote:
>>>> Is there a (good) example of using h2o for sentiment analysis? Best regardsJulian
>>> @Alex,
>>>
>>> I am unable to access the link you pointed -
>>>
>>>
https://github.com/h2oai/sparkling-water/blob/master/examples/scripts/craigslistJobTitles.scala
>> It is here:
>>
https://github.com/h2oai/sparkling-water/blob/master/examples/scripts/craigslistJobTitles.script.scala
>>
>> Michal
>>> Did this move elsewhere?
>>>
>>>
> Thanks Michal, just need additional help here -
>
>
> val title_vectors = words.map(x => new DenseVector(
> divArray(x.map(m => wordToVector(m, model).toArray).
> reduceLeft(sumArray),x.length)).asInstanceOf[Vector])
For each row, which is represented by an array of tokens (["development", "job"]) it applies
existing word2vec model on each word (x.map(m => wordToVector(m, model).toArray) and sums the
resulting vectors together(reduceLeft(sumArray)). The result is a vector representing a row.
["development", "job"] => [ [0,1,0.3, ...], [0.89, 0.8, 0, ....] ] => [0.89, 1.2, 0, ...]
Does it make sense?
michal