clingku / w2v_kr

This repository includes scripts and text resources related to the task of automatic compositionality detection using word2vec embeddings. We test the applicability of the method to ambiguous phrases for Korean language.
Apache License 2.0
1 stars 0 forks source link

bin파일 검색도구: distance #6

Open hauni opened 7 years ago

hauni commented 7 years ago

본래 배포된 것(distance.c)으로는 개별 어휘를 입력해서 결과를 구하도록 되어 있고, 검색어에 가장 유사한 40개의 출력물을 보여주는 형식임.

이중 출력물 결과 갯수는 distance.c의 line 23의 출력 갯수를 조정해 준 뒤 다시 compile하면 될 듯.

const long long max_size = 2000; // max length of strings const long long N = 40; // number of closest words that will be shown const long long max_w = 50; // max length of vocabulary entries

그리고 검색어를 매번 입력하기 보다는 list를 만들어 모두 출력하도록 해 주는 것이 더 바람직한 방법. 이는 distance.c를 약간 변경시켜주면 될텐데, 해당 코드 distance_list.c를 code로 별도 업로드. 단 입력 목록 (예: list.txt)는 utf8으로 해 주어야 할 것임. 2015년도에 사용해 본 것인데, 이번에는 아직 확인 못했음.

hauni commented 7 years ago

distance_list.c 실행방법 (아래의 distance를 distance_list로 바꿔주어야)

make clean make distance ./distance vectorsKs.bin test1.txt > out.txt 이렇게 하면 결과값은 out.txt에 저장 ------------기타 그전에 참고사항: makefile 말씀하셨는데, makefile을 다운받으셔서 같은 directory에 두시고 make distance 라고 치시면, 거기서 지정한 distance.c 파일 컴파일링이 진행돼요. make clean 라고 치면 기존에 생성된 실행파일이 모두 삭제