<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[130058] trunk/dports/textproc/word2vec</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/130058">130058</a></dd>
<dt>Author</dt> <dd>hum@macports.org</dd>
<dt>Date</dt> <dd>2014-12-25 03:59:20 -0800 (Thu, 25 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>word2vec: update to 20140915; disable mt variant; add livecheck</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportstextprocword2vecPortfile">trunk/dports/textproc/word2vec/Portfile</a></li>
<li><a href="#trunkdportstextprocword2vecfilespatchdemodiff">trunk/dports/textproc/word2vec/files/patch-demo.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportstextprocword2vecPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/textproc/word2vec/Portfile (130057 => 130058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/textproc/word2vec/Portfile        2014-12-25 10:53:41 UTC (rev 130057)
+++ trunk/dports/textproc/word2vec/Portfile        2014-12-25 11:59:20 UTC (rev 130058)
</span><span class="lines">@@ -4,8 +4,7 @@
</span><span class="cx"> PortSystem          1.0
</span><span class="cx"> 
</span><span class="cx"> name                word2vec
</span><del>-version             20131218
-revision            1
</del><ins>+version             20140915
</ins><span class="cx"> categories          textproc
</span><span class="cx"> maintainers         hum openmaintainer
</span><span class="cx"> 
</span><span class="lines">@@ -23,9 +22,11 @@
</span><span class="cx"> 
</span><span class="cx"> fetch.type          svn
</span><span class="cx"> svn.url             http://word2vec.googlecode.com/svn/trunk
</span><del>-svn.revision        37
</del><ins>+svn.revision        41
</ins><span class="cx"> worksrcdir          trunk
</span><span class="cx"> 
</span><ins>+depends_run         port:wget
+
</ins><span class="cx"> patchfiles          patch-malloc.diff \
</span><span class="cx">                     patch-compute-accuracy.c.diff \
</span><span class="cx">                     patch-demo.diff
</span><span class="lines">@@ -33,7 +34,7 @@
</span><span class="cx"> use_configure       no
</span><span class="cx"> variant universal   {}
</span><span class="cx"> 
</span><del>-configure.optflags  -O2
</del><ins>+configure.optflags  -O3
</ins><span class="cx"> 
</span><span class="cx"> build.args          CC=&quot;${configure.cc}&quot; \
</span><span class="cx">                     CFLAGS=&quot;${configure.cflags} [get_canonical_archflags] -lm -pthread -Wall -funroll-loops&quot;
</span><span class="lines">@@ -63,16 +64,9 @@
</span><span class="cx">         ${destroot}${docdir}
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-variant mt description {Apply multiple threads patch} {
-    distfiles-append    word2vec.local.tgz:mt
-    master_sites-append http://www.chokkan.org/software/word2vec-multi/:mt
-    checksums           rmd160  5c9092531f1c4d8f5482359e9d78f847adcd260c \
-                        sha256  57476a59f3f485ee5ada7214caf67fcbfa53f78283a7e85c5b6c764a96171844
-    post-patch {
-        system -W ${worksrcpath} &quot;patch -p1 &lt; ${workpath}/word2vec.local/word2vec.local.patch&quot;
-    }
-}
</del><ins>+variant mt description {disabled: Apply multiple threads patch} {}
</ins><span class="cx"> 
</span><del>-default_variants    +mt
-
-livecheck.type      none
</del><ins>+livecheck.type      regex
+livecheck.url       https://code.google.com/p/word2vec/source/list
+livecheck.version   ${svn.revision}
+livecheck.regex     r(\\d+)
</ins></span></pre></div>
<a id="trunkdportstextprocword2vecfilespatchdemodiff"></a>
<div class="modfile"><h4>Modified: trunk/dports/textproc/word2vec/files/patch-demo.diff (130057 => 130058)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/textproc/word2vec/files/patch-demo.diff        2014-12-25 10:53:41 UTC (rev 130057)
+++ trunk/dports/textproc/word2vec/files/patch-demo.diff        2014-12-25 11:59:20 UTC (rev 130058)
</span><span class="lines">@@ -1,116 +1,72 @@
</span><del>---- demo-analogy.sh.orig        2014-02-22 20:36:04.000000000 +0900
-+++ demo-analogy.sh        2014-02-22 20:27:27.000000000 +0900
-@@ -1,11 +1,13 @@
--make
-+#!/bin/sh
- if [ ! -e text8 ]; then
--  wget http://mattmahoney.net/dc/text8.zip -O text8.gz
--  gzip -d text8.gz -f
-+  curl -O http://mattmahoney.net/dc/text8.zip
-+  unzip text8.zip
- fi
- echo -----------------------------------------------------------------------------------------------------
- echo Note that for the word analogy to perform well, the models should be trained on much larger data sets
</del><ins>+--- demo-analogy.sh.orig        2014-09-07 01:54:27.000000000 +0900
++++ demo-analogy.sh        2014-12-24 22:55:24.000000000 +0900
+@@ -7,5 +7,5 @@
+ echo Note that for the word analogy to perform well, the model should be trained on much larger data set
</ins><span class="cx">  echo Example input: paris france berlin
</span><del>- echo -----------------------------------------------------------------------------------------------------
--time ./word2vec -train text8 -output vectors.bin -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1
</del><ins>+ echo ---------------------------------------------------------------------------------------------------
+-time ./word2vec -train text8 -output vectors.bin -cbow 1 -size 200 -window 8 -negative 25 -hs 0 -sample 1e-4 -threads 20 -binary 1 -iter 15
</ins><span class="cx"> -./word-analogy vectors.bin
</span><del>-+if [ ! -e vectors.bin ]; then
-+  time @EXECDIR@/word2vec -train text8 -output vectors.bin -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1
-+fi
</del><ins>++time @EXECDIR@/word2vec -train text8 -output vectors.bin -cbow 1 -size 200 -window 8 -negative 25 -hs 0 -sample 1e-4 -threads 20 -binary 1 -iter 15
</ins><span class="cx"> +@EXECDIR@/word-analogy vectors.bin
</span><del>---- demo-classes.sh.orig        2014-02-22 20:36:09.000000000 +0900
-+++ demo-classes.sh        2014-02-22 20:22:53.000000000 +0900
-@@ -1,8 +1,8 @@
--make
-+#!/bin/sh
- if [ ! -e text8 ]; then
--  wget http://mattmahoney.net/dc/text8.zip -O text8.gz
--  gzip -d text8.gz -f
-+  curl -O http://mattmahoney.net/dc/text8.zip
-+  unzip text8.zip
</del><ins>+--- demo-classes.sh.orig        2014-09-07 01:54:27.000000000 +0900
++++ demo-classes.sh        2014-12-24 22:57:00.000000000 +0900
+@@ -3,6 +3,6 @@
+   wget http://mattmahoney.net/dc/text8.zip -O text8.gz
+   gzip -d text8.gz -f
</ins><span class="cx">  fi
</span><del>--time ./word2vec -train text8 -output classes.txt -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -classes 500
-+time @EXECDIR@/word2vec -train text8 -output classes.txt -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -classes 500
</del><ins>+-time ./word2vec -train text8 -output classes.txt -cbow 1 -size 200 -window 8 -negative 25 -hs 0 -sample 1e-4 -threads 20 -iter 15 -classes 500
++time @EXECDIR@/word2vec -train text8 -output classes.txt -cbow 1 -size 200 -window 8 -negative 25 -hs 0 -sample 1e-4 -threads 20 -iter 15 -classes 500
</ins><span class="cx">  sort classes.txt -k 2 -n &gt; classes.sorted.txt
</span><span class="cx">  echo The word classes were saved to file classes.sorted.txt
</span><del>---- demo-phrase-accuracy.sh.orig        2014-02-22 20:36:25.000000000 +0900
-+++ demo-phrase-accuracy.sh        2014-02-22 20:29:40.000000000 +0900
-@@ -1,12 +1,14 @@
--make
-+#!/bin/sh
- if [ ! -e text8 ]; then
--  wget http://mattmahoney.net/dc/text8.zip -O text8.gz
--  gzip -d text8.gz -f
-+  curl -O http://mattmahoney.net/dc/text8.zip
-+  unzip text8.zip
</del><ins>+--- demo-phrase-accuracy.sh.orig        2014-09-07 01:54:27.000000000 +0900
++++ demo-phrase-accuracy.sh        2014-12-24 22:57:51.000000000 +0900
+@@ -4,8 +4,8 @@
+   gzip -d news.2012.en.shuffled.gz -f
</ins><span class="cx">  fi
</span><del>- echo ----------------------------------------------------------------------------------------------------------------
- echo Note that the accuracy and coverage of the test set questions is going to be low with this small training corpus
- echo To achieve better accuracy, larger training set is needed
- echo ----------------------------------------------------------------------------------------------------------------
--time ./word2phrase -train text8 -output text8-phrase -threshold 500 -debug 2 -min-count 3
--time ./word2vec -train text8-phrase -output vectors-phrase.bin -cbow 0 -size 300 -window 10 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1 -min-count 3
--./compute-accuracy vectors-phrase.bin &lt;questions-phrases.txt
-+if [ ! -e vectors-phrase.bin ]; then
-+  time @EXECDIR@/word2phrase -train text8 -output text8-phrase -threshold 500 -debug 2 -min-count 3
-+  time @EXECDIR@/word2vec -train text8-phrase -output vectors-phrase.bin -cbow 0 -size 300 -window 10 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1 -min-count 3
-+fi
-+@EXECDIR@/compute-accuracy vectors-phrase.bin &lt; @EXDIR@/questions-phrases.txt
---- demo-phrases.sh.orig        2014-02-22 20:36:17.000000000 +0900
-+++ demo-phrases.sh        2014-02-22 20:30:19.000000000 +0900
-@@ -1,8 +1,10 @@
--make
-+#!/bin/sh
- if [ ! -e text8 ]; then
--  wget http://mattmahoney.net/dc/text8.zip -O text8.gz
--  gzip -d text8.gz -f
-+  curl -O http://mattmahoney.net/dc/text8.zip
-+  unzip text8.zip
</del><ins>+ sed -e &quot;s/’/'/g&quot; -e &quot;s/′/'/g&quot; -e &quot;s/''/ /g&quot; &lt; news.2012.en.shuffled | tr -c &quot;A-Za-z'_ \n&quot; &quot; &quot; &gt; news.2012.en.shuffled-norm0
+-time ./word2phrase -train news.2012.en.shuffled-norm0 -output news.2012.en.shuffled-norm0-phrase0 -threshold 200 -debug 2
+-time ./word2phrase -train news.2012.en.shuffled-norm0-phrase0 -output news.2012.en.shuffled-norm0-phrase1 -threshold 100 -debug 2
++time @EXECDIR@/word2phrase -train news.2012.en.shuffled-norm0 -output news.2012.en.shuffled-norm0-phrase0 -threshold 200 -debug 2
++time @EXECDIR@/word2phrase -train news.2012.en.shuffled-norm0-phrase0 -output news.2012.en.shuffled-norm0-phrase1 -threshold 100 -debug 2
+ tr A-Z a-z &lt; news.2012.en.shuffled-norm0-phrase1 &gt; news.2012.en.shuffled-norm1-phrase1
+-time ./word2vec -train news.2012.en.shuffled-norm1-phrase1 -output vectors-phrase.bin -cbow 1 -size 200 -window 10 -negative 25 -hs 0 -sample 1e-5 -threads 20 -binary 1 -iter 15
+-./compute-accuracy vectors-phrase.bin &lt; questions-phrases.txt
++time @EXECDIR@/word2vec -train news.2012.en.shuffled-norm1-phrase1 -output vectors-phrase.bin -cbow 1 -size 200 -window 10 -negative 25 -hs 0 -sample 1e-5 -threads 20 -binary 1 -iter 15
++@EXECDIR@/compute-accuracy vectors-phrase.bin &lt; questions-phrases.txt
+--- demo-phrases.sh.orig        2014-09-07 01:54:27.000000000 +0900
++++ demo-phrases.sh        2014-12-24 22:58:20.000000000 +0900
+@@ -4,8 +4,8 @@
+   gzip -d news.2012.en.shuffled.gz -f
</ins><span class="cx">  fi
</span><del>--time ./word2phrase -train text8 -output text8-phrase -threshold 500 -debug 2
--time ./word2vec -train text8-phrase -output vectors-phrase.bin -cbow 0 -size 300 -window 10 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1
</del><ins>+ sed -e &quot;s/’/'/g&quot; -e &quot;s/′/'/g&quot; -e &quot;s/''/ /g&quot; &lt; news.2012.en.shuffled | tr -c &quot;A-Za-z'_ \n&quot; &quot; &quot; &gt; news.2012.en.shuffled-norm0
+-time ./word2phrase -train news.2012.en.shuffled-norm0 -output news.2012.en.shuffled-norm0-phrase0 -threshold 200 -debug 2
+-time ./word2phrase -train news.2012.en.shuffled-norm0-phrase0 -output news.2012.en.shuffled-norm0-phrase1 -threshold 100 -debug 2
++time @EXECDIR@/word2phrase -train news.2012.en.shuffled-norm0 -output news.2012.en.shuffled-norm0-phrase0 -threshold 200 -debug 2
++time @EXECDIR@/word2phrase -train news.2012.en.shuffled-norm0-phrase0 -output news.2012.en.shuffled-norm0-phrase1 -threshold 100 -debug 2
+ tr A-Z a-z &lt; news.2012.en.shuffled-norm0-phrase1 &gt; news.2012.en.shuffled-norm1-phrase1
+-time ./word2vec -train news.2012.en.shuffled-norm1-phrase1 -output vectors-phrase.bin -cbow 1 -size 200 -window 10 -negative 25 -hs 0 -sample 1e-5 -threads 20 -binary 1 -iter 15
</ins><span class="cx"> -./distance vectors-phrase.bin
</span><del>-\ No newline at end of file
-+if [ ! -e vectors-phrase.bin ]; then
-+  time @EXECDIR@/word2phrase -train text8 -output text8-phrase -threshold 500 -debug 2
-+  time @EXECDIR@/word2vec -train text8-phrase -output vectors-phrase.bin -cbow 0 -size 300 -window 10 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1
-+fi
</del><ins>++time @EXECDIR@/word2vec -train news.2012.en.shuffled-norm1-phrase1 -output vectors-phrase.bin -cbow 1 -size 200 -window 10 -negative 25 -hs 0 -sample 1e-5 -threads 20 -binary 1 -iter 15
</ins><span class="cx"> +@EXECDIR@/distance vectors-phrase.bin
</span><del>---- demo-word-accuracy.sh.orig        2014-02-22 20:36:32.000000000 +0900
-+++ demo-word-accuracy.sh        2014-02-22 20:31:16.000000000 +0900
-@@ -1,8 +1,10 @@
--make
-+#!/bin/sh
- if [ ! -e text8 ]; then
--  wget http://mattmahoney.net/dc/text8.zip -O text8.gz
--  gzip -d text8.gz -f
-+  curl -O http://mattmahoney.net/dc/text8.zip
-+  unzip text8.zip
</del><ins>+--- demo-word-accuracy.sh.orig        2014-09-07 01:54:27.000000000 +0900
++++ demo-word-accuracy.sh        2014-12-24 22:58:49.000000000 +0900
+@@ -3,6 +3,6 @@
+   wget http://mattmahoney.net/dc/text8.zip -O text8.gz
+   gzip -d text8.gz -f
</ins><span class="cx">  fi
</span><del>--time ./word2vec -train text8 -output vectors.bin -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1
</del><ins>+-time ./word2vec -train text8 -output vectors.bin -cbow 1 -size 200 -window 8 -negative 25 -hs 0 -sample 1e-4 -threads 20 -binary 1 -iter 15
</ins><span class="cx"> -./compute-accuracy vectors.bin 30000 &lt; questions-words.txt
</span><span class="cx"> -# to compute accuracy with the full vocabulary, use: ./compute-accuracy vectors.bin &lt; questions-words.txt
</span><del>-+if [ ! -e vectors.bin ]; then
-+  time @EXECDIR@/word2vec -train text8 -output vectors.bin -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1
-+fi
-+@EXECDIR@/compute-accuracy vectors.bin 30000 &lt; @EXDIR@/questions-words.txt
-+# to compute accuracy with the full vocabulary, use: @EXECDIR@/compute-accuracy vectors.bin &lt; @EXDIR@/questions-words.txt
---- demo-word.sh.orig        2014-02-22 20:36:47.000000000 +0900
-+++ demo-word.sh        2014-02-22 20:31:57.000000000 +0900
-@@ -1,7 +1,9 @@
--make
-+#!/bin/sh
- if [ ! -e text8 ]; then
--  wget http://mattmahoney.net/dc/text8.zip -O text8.gz
--  gzip -d text8.gz -f
-+  curl -O http://mattmahoney.net/dc/text8.zip
-+  unzip text8.zip
</del><ins>++time @EXECDIR@/word2vec -train text8 -output vectors.bin -cbow 1 -size 200 -window 8 -negative 25 -hs 0 -sample 1e-4 -threads 20 -binary 1 -iter 15
++@EXECDIR@/compute-accuracy vectors.bin 30000 &lt; questions-words.txt
++# to compute accuracy with the full vocabulary, use: @EXECDIR@/compute-accuracy vectors.bin &lt; questions-words.txt
+--- demo-word.sh.orig        2014-09-07 01:54:27.000000000 +0900
++++ demo-word.sh        2014-12-24 22:59:00.000000000 +0900
+@@ -3,5 +3,5 @@
+   wget http://mattmahoney.net/dc/text8.zip -O text8.gz
+   gzip -d text8.gz -f
</ins><span class="cx">  fi
</span><del>--time ./word2vec -train text8 -output vectors.bin -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1
</del><ins>+-time ./word2vec -train text8 -output vectors.bin -cbow 1 -size 200 -window 8 -negative 25 -hs 0 -sample 1e-4 -threads 20 -binary 1 -iter 15
</ins><span class="cx"> -./distance vectors.bin
</span><del>-\ No newline at end of file
-+if [ ! -e vectors.bin ]; then
-+  time @EXECDIR@/word2vec -train text8 -output vectors.bin -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1
-+fi
</del><ins>++time @EXECDIR@/word2vec -train text8 -output vectors.bin -cbow 1 -size 200 -window 8 -negative 25 -hs 0 -sample 1e-4 -threads 20 -binary 1 -iter 15
</ins><span class="cx"> +@EXECDIR@/distance vectors.bin
</span></span></pre>
</div>
</div>

</body>
</html>