2014-03-14 :-(
_ 午後
1300 デバッグしTARI
_ [nlp][機械学習][自然言語処理][word2vec]word2vec を入れてみた
cygwin でやる。
NetBSD ( VMWare ) では svn で取得できないうえに gmake してもエラーになったんだが深追いしてない。
$ svn checkout http://word2vec.googlecode.com/svn/trunk/ A trunk/word2phrase.c A trunk/LICENSE A trunk/word-analogy.c A trunk/demo-analogy.sh A trunk/compute-accuracy.c A trunk/demo-classes.sh A trunk/demo-word-accuracy.sh A trunk/demo-phrases.sh A trunk/questions-words.txt A trunk/demo-phrase-accuracy.sh A trunk/demo-word.sh A trunk/distance.c A trunk/README.txt A trunk/questions-phrases.txt A trunk/word2vec.c A trunk/makefile リビジョン 37 をチェックアウトしました。
cd word2vec
$ make gcc word2vec.c -o word2vec -lm -pthread -Ofast -march=native -Wall -funroll-loops -Wno-unused-result gcc word2phrase.c -o word2phrase -lm -pthread -Ofast -march=native -Wall -funroll-loops -Wno-unused-result gcc distance.c -o distance -lm -pthread -Ofast -march=native -Wall -funroll-loops -Wno-unused-result gcc word-analogy.c -o word-analogy -lm -pthread -Ofast -march=native -Wall -funroll-loops -Wno-unused-result gcc compute-accuracy.c -o compute-accuracy -lm -pthread -Ofast -march=native -Wall -funroll-loops -Wno-unused-result compute-accuracy.c: 関数 ‘main’ 内: compute-accuracy.c:57:5: 警告: 配列の添字が ‘char’ 型です [-Wchar-subscripts] for (a = 0; a < max_w; a++) vocab[b * max_w + a] = toupper(vocab[b * max_w + a]); ^ compute-accuracy.c:70:5: 警告: 配列の添字が ‘char’ 型です [-Wchar-subscripts] for (a = 0; a < strlen(st1); a++) st1[a] = toupper(st1[a]); ^ compute-accuracy.c:87:5: 警告: 配列の添字が ‘char’ 型です [-Wchar-subscripts] for (a = 0; a < strlen(st2); a++) st2[a] = toupper(st2[a]); ^ compute-accuracy.c:89:5: 警告: 配列の添字が ‘char’ 型です [-Wchar-subscripts] for (a = 0; a<strlen(st3); a++) st3[a] = toupper(st3[a]); ^ compute-accuracy.c:91:5: 警告: 配列の添字が ‘char’ 型です [-Wchar-subscripts] for (a = 0; a < strlen(st4); a++) st4[a] = toupper(st4[a]); ^ chmod +x *.sh
ためす
./demo-word.sh Enter word or sentence (EXIT to break): netbsd Word: netbsd Position in vocabulary: 30320 Word Cosine distance ------------------------------------------------------------------------ kfreebsd 0.944774 gentoo 0.892071 freebsd 0.891465 openbsd 0.868264 solaris 0.827737 porting 0.827641 openldap 0.825326 developerworks 0.816077 internals 0.805856 hurd 0.804656 vmware 0.798300 msx 0.797613 applesoft 0.796830 softpanorama 0.795982 userland 0.793972 toolchain 0.791783 dragonfly 0.786035 toolset 0.785750 assembler 0.783317 emulators 0.781905 vim 0.781463 installer 0.779598 binaries 0.778890 readme 0.778707 isc 0.777469 morphos 0.777180 debugger 0.775210 ide 0.774312 gdb 0.770051 firmware 0.769136 ubuntu 0.767238 emulator 0.766893 roms 0.766083 interbase 0.764577 ecl 0.764529 microkernel 0.763369 customized 0.762985 trustedbsd 0.759201 blitter 0.757732 suse 0.757717
[ツッコミを入れる]