Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/2952#discussion_r19451852
--- Diff: docs/mllib-feature-extraction.md ---
@@ -162,6 +162,28 @@ for((synonym, cosineSimilarity) <- synonyms) {
}
{% endhighlight %}
</div>
+<div data-lang="python">
+{% highlight python %}
+# example uses text8 file from http://mattmahoney.net/dc/text8.zip
+# the file was unziped and split into multiple lines using
+# grep -o '[^ ]\+' text8 > text8_lines
--- End diff --
The input to `Word2Vec` should be sentences instead of individual words,
though it doesn't affect the implementation. The following command extract 16
words per line.
~~~
grep -o -E '\w+(\W+\w+){0,15}' text8 > text8_lines
~~~
---
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]