forked from mikemccand/luceneutil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
185 lines (161 loc) · 7.18 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<project name="luceneutil-1.0" basedir="." default="build">
<property name="data.dir" value="${basedir}/../data"/>
<property name="tasks.dir" value="${basedir}/tasks"/>
<property name="lucene.checkout" value="${basedir}/../lucene"/>
<target name="build">
<mkdir dir="build"/>
<path id="build.classpath">
<pathelement location="build"/>
<fileset dir="${lucene.checkout}/lucene/core/build/libs/">
<include name="*.jar"/>
</fileset>
</path>
<javac srcdir="src/main"
destdir="build"
includes="KnnGraphTester.java,WikiVectors.java,perf/VectorDictionary.java"
classpathref="build.classpath"
includeantruntime="false"/>
<!-- run a test; we don't have any framework, just call a test method -->
<java className="WikiVectors" classpathref="build.classpath">
<arg value="--test"/>
</java>
</target>
<target name="extract-vector-tasks">
<copy file="${tasks.dir}/vector.tasks" tofile="${tasks.dir}/vector.task.txt">
<filterchain>
<tokenfilter>
<replaceregex pattern=".*//(.*) # .*" replace="\1"/>
</tokenfilter>
</filterchain>
</copy>
</target>
<target name="vectors300-tasks" depends="build,extract-vector-tasks">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="${data.dir}/glove.6B.300d.txt"/>
<arg value="${tasks.dir}/vector.task.txt"/>
<arg value="${tasks.dir}/vector-task-300d.vec"/>
</java>
</target>
<target name="vectors300-docs" depends="build">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="${data.dir}/glove.6B.300d.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-fixed-utf8-with-random-label.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-300d.vec"/>
</java>
</target>
<target name="vectors300-8bit-docs" depends="build">
<java className="WikiVectors" classpathref="build.classpath">
<!-- scale extrapolated from 100-dim by comparing 1/99%ile -->
<!--
1 Percentile = -0.16812261939048767
10 Percentile = -0.05280676484107971
50 Percentile = 0.0016044741496443748
90 Percentile = 0.052327241748571396
99 Percentile = 0.12062523514032364
100 Percentile = 0.500967800617218
average: -0.0013391887
stddev: 0.05804375
min .. max: -0.6463034 .. 0.5009678
-->
<arg value="-scale"/>
<arg value="256"/>
<arg value="${data.dir}/glove.6B.300d.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-fixed-utf8-with-random-label.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-300d-8bit.vec"/>
</java>
</target>
<target name="vectors300-8bit-tasks" depends="build">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="-scale"/>
<arg value="256"/>
<arg value="${data.dir}/glove.6B.300d.txt"/>
<arg value="${tasks.dir}/vector.task.txt"/>
<arg value="${tasks.dir}/vector-task-300d-8bit.vec"/>
</java>
</target>
<target name="vectors300" depends="vectors300-tasks,vectors300-docs,vectors300-8bit-docs,vectors300-8bit-tasks"/>
<target name="vectors100-tasks" depends="build,extract-vector-tasks">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="${data.dir}/glove.6B.100d.txt"/>
<arg value="${tasks.dir}/vector.task.txt"/>
<arg value="${tasks.dir}/vector-task-100d.vec"/>
</java>
</target>
<target name="vectors100-docs" depends="build">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="${data.dir}/glove.6B.100d.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-fixed-utf8-with-random-label.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-100d.vec"/>
</java>
</target>
<target name="vectors100-8bit-docs" depends="build">
<java className="WikiVectors" classpathref="build.classpath">
<!-- scale was determined empirically, testing recall -->
<!--
1 Percentile = -0.325579971075058
10 Percentile = -0.09507450535893414
50 Percentile = -0.00024916713300626725
90 Percentile = 0.10140283405780792
99 Percentile = 0.25520724058151245
100 Percentile = 0.5750676989555359
average: -0.0012661816
stddev: 0.10003442
min .. max: -0.7082266 .. 0.5750677
-->
<arg value="-scale"/>
<arg value="128"/>
<arg value="${data.dir}/glove.6B.100d.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-fixed-utf8-with-random-label.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-100d-8bit.vec"/>
</java>
</target>
<target name="vectors100-8bit-tasks" depends="build">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="-scale"/>
<arg value="256"/>
<arg value="${data.dir}/glove.6B.100d.txt"/>
<arg value="${tasks.dir}/vector.task.txt"/>
<arg value="${tasks.dir}/vector-task-100d-8bit.vec"/>
</java>
</target>
<!-- don't scale the task data here; we'll do it later after summing vectors for each term -->
<target name="vectors100" depends="vectors100-tasks,vectors100-docs,vectors100-8bit-docs,vectors100-8bit-tasks"/>
<!-- 384-dim vectors trained using all-MiniLM-L6-v2 from https://www.sbert.net/ -->
<target name="vectors-minilm-tasks" depends="build,extract-vector-tasks">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="${data.dir}/../data/enwiki-20120502-minilm.tok"/>
<arg value="${data.dir}/../data/enwiki-20120502-minilm.vec"/>
<arg value="384"/>
<arg value="${tasks.dir}/vector.task.txt"/>
<arg value="${tasks.dir}/vector-task-minilm.vec"/>
</java>
</target>
<target name="vectors-minilm-docs" depends="build">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="${data.dir}/../data/enwiki-20120502-minilm.tok"/>
<arg value="${data.dir}/../data/enwiki-20120502-minilm.vec"/>
<arg value="384"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-fixed-utf8-with-random-label.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-minilm.vec"/>
</java>
</target>
<!-- 768-dim vectors trained using mpnet from https://www.sbert.net/ -->
<target name="vectors-mpnet-tasks" depends="build,extract-vector-tasks">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="${data.dir}/../data/enwiki-20120502-mpnet.tok"/>
<arg value="${data.dir}/../data/enwiki-20120502-mpnet.vec"/>
<arg value="768"/>
<arg value="${tasks.dir}/vector.task.txt"/>
<arg value="${tasks.dir}/vector-task-mpnet.vec"/>
</java>
</target>
<target name="vectors-mpnet-docs" depends="build">
<java className="WikiVectors" classpathref="build.classpath">
<arg value="${data.dir}/../data/enwiki-20120502-mpnet.tok"/>
<arg value="${data.dir}/../data/enwiki-20120502-mpnet.vec"/>
<arg value="768"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-fixed-utf8-with-random-label.txt"/>
<arg value="${data.dir}/enwiki-20120502-lines-1k-mpnet.vec"/>
</java>
</target>
</project>