-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sbt
309 lines (283 loc) · 10.7 KB
/
build.sbt
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
// phuonglh, May 3, 2020
// updated December 15, 2021 (upgrade to Spark 3.2.0 and BigDL 0.13.0)
val sparkVersion = "3.2.0"
val jobServerVersion = "0.11.1"
javacOptions ++= Seq("-encoding", "UTF-8", "-XDignore.symbol.file", "true")
scalacOptions ++= Seq("-Xfatal-warnings", "-deprecation", "-feature", "-unchecked",
"-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-language:postfixOps"
)
lazy val commonSettings = Seq(
scalaVersion := "2.12.15",
name := "vlp",
organization := "phuonglh.com",
version := "1.0",
libraryDependencies ++= Seq(
"org.apache.spark" %% "spark-core" % sparkVersion % "provided",
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided",
"org.apache.spark" %% "spark-mllib" % sparkVersion % "provided",
// BigDL version 0.13.0 uses Spark 3.0.0
"com.intel.analytics.bigdl" % "bigdl-SPARK_3.0" % "0.13.0" % "provided",
// Analytics Zoo version 0.11.0 uses BigDL version 0.13.0
"com.intel.analytics.zoo" % "analytics-zoo-bigdl_0.13.0-spark_3.0.0" % "0.11.0" % "provided",
"com.intel.analytics.zoo" % "zoo-core-mkl-mac" % "0.11.0" % "provided",
"com.intel.analytics.zoo" % "zoo-core-mkl-linux" % "0.11.0" % "provided",
"com.github.scopt" %% "scopt" % "3.7.1",
),
run in Compile := Defaults.runTask(fullClasspath in Compile, mainClass in (Compile, run), runner in (Compile, run)).evaluated,
runMain in Compile := Defaults.runMainTask(fullClasspath in Compile, runner in(Compile, run)).evaluated
)
// root project
lazy val root = (project in file(".")).aggregate(tok, tag, tdp, ner, tpm, tcl, idx, vdr, vdg, vec, zoo, biz, nli, sjs, qas, nlm)
// Analytic Zoo (for assembly as a uber jar to be used as a dependency)
lazy val biz = (project in file("biz"))
.settings(
commonSettings,
assemblyJarName in assembly := "biz.jar",
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
// BigDL version 0.13.0 uses Spark 3.0.0
"com.intel.analytics.bigdl" % "bigdl-SPARK_3.0" % "0.13.0",
// Analytics Zoo version 0.11.0 uses BigDL version 0.13.0
"com.intel.analytics.zoo" % "analytics-zoo-bigdl_0.13.0-spark_3.0.0" % "0.11.0",
),
assemblyMergeStrategy in assembly := {
case x if x.contains("com/intel/analytics/bigdl/bigquant/") => MergeStrategy.first
case x if x.contains("com/intel/analytics/bigdl/mkl/") => MergeStrategy.first
case x if x.contains("org/tensorflow/") => MergeStrategy.first
case x if x.contains("google/protobuf") => MergeStrategy.first
case x if x.contains("org/apache/spark/unused") => MergeStrategy.first
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)
// tokenization module
lazy val tok = (project in file("tok"))
.settings(
commonSettings,
mainClass in assembly := Some("vlp.tok.VietnameseTokenizer"),
assemblyJarName in assembly := "tok.jar"
)
// part-of-speech tagging module
lazy val tag = (project in file("tag"))
.dependsOn(tok)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.tag.Tagger"),
assemblyJarName in assembly := "tag.jar"
)
// transition-based dependency parsing module
lazy val tdp = (project in file("tdp"))
.dependsOn(tag)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.tdp.Parser"),
assemblyJarName in assembly := "tdp.jar",
libraryDependencies ++= Seq(
"com.github.fommil.netlib" % "all" % "1.1.2" pomOnly()
)
)
// named entity recognization module
lazy val ner = (project in file("ner"))
.dependsOn(tag, biz)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.ner.Tagger"),
assemblyJarName in assembly := "ner.jar",
libraryDependencies ++= Seq()
)
// topic modeling module
lazy val tpm = (project in file("tpm"))
.dependsOn(tok)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.tpm.LDA"),
assemblyJarName in assembly := "tpm.jar"
)
// text classification module
lazy val tcl = (project in file("tcl"))
.dependsOn(tok)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.tcl.Classifier"),
assemblyJarName in assembly := "tcl.jar",
libraryDependencies ++= Seq(
)
)
// text indexing module
lazy val idx = (project in file("idx"))
.settings(
commonSettings,
mainClass in assembly := Some("vlp.idx.NewsIndexer"),
assemblyJarName in assembly := "idx.jar",
libraryDependencies ++= Seq(
"mysql" % "mysql-connector-java" % "8.0.16",
"org.elasticsearch.client" % "elasticsearch-rest-high-level-client" % "7.1.1",
"de.l3s.boilerpipe" % "boilerpipe" % "1.1.0",
"xerces" % "xercesImpl" % "2.11.0",
"net.sourceforge.nekohtml" % "nekohtml" % "1.9.22" % "provided",
"org.glassfish" % "javax.json" % "1.1.4",
"org.apache.kafka" % "kafka-clients" % "2.6.0"
),
run / fork := true,
run / javaOptions ++= Seq("-Xmx8g", "-Djdk.tls.trustNameService=true", "-Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true")
)
// Vietnamese diacritics restoration module (CMM-based approach)
lazy val vdr = (project in file("vdr"))
.settings(
commonSettings,
mainClass in assembly := Some("vlp.vdr.Restorer"),
assemblyJarName in assembly := "vdr.jar",
libraryDependencies ++= Seq()
)
// Vietnamese diacritics generation module (RNN-based approaches)
lazy val vdg = (project in file("vdg"))
.dependsOn(tok, biz)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.vdg.Generator"),
assemblyJarName in assembly := "vdg.jar",
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq()
)
// Natural language inference module
lazy val nli = (project in file("nli"))
.dependsOn(tag, biz)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.nli.Teller"),
assemblyJarName in assembly := "nli.jar",
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
"org.scalaj" %% "scalaj-http" % "2.4.2",
)
)
// Word to vector module
lazy val vec = (project in file("vec"))
.dependsOn(tok)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.vec.W2V"),
assemblyJarName in assembly := "vec.jar",
resolvers += Resolver.mavenLocal
)
// Models that depend on the Analytic Zoo framework
lazy val zoo = (project in file("zoo"))
.dependsOn(tok, biz)
.settings(
commonSettings,
assemblyJarName in assembly := "zoo.jar",
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(),
assemblyMergeStrategy in assembly := {
case x if x.contains("log4j.properties") => MergeStrategy.first
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)
// Spark-JobServer module
lazy val sjs = (project in file("sjs"))
.dependsOn(tdp, ner)
.settings(
commonSettings,
assemblyJarName in assembly := "sjs.jar",
resolvers ++= Seq("Artifactory" at "https://sparkjobserver.jfrog.io/artifactory/jobserver/"),
libraryDependencies ++= Seq(
"spark.jobserver" %% "job-server-api" % jobServerVersion % "provided",
"spark.jobserver" %% "job-server-extras" % jobServerVersion % "provided"
)
)
// Text Mining Insights for Vietnam's Post-Pandemic Green Recovery module
lazy val tmi = (project in file("tmi"))
.dependsOn(tpm)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.tmi.NewsIndexer"),
assemblyJarName in assembly := "tmi.jar",
libraryDependencies ++= Seq(
"de.l3s.boilerpipe" % "boilerpipe" % "1.1.0",
"xerces" % "xercesImpl" % "2.11.0",
"net.sourceforge.nekohtml" % "nekohtml" % "1.9.22" % "provided",
"org.glassfish" % "javax.json" % "1.1.4",
"org.apache.kafka" % "kafka-clients" % "2.6.0",
"org.scalaj" %% "scalaj-http" % "2.4.2",
"org.twitter4j" % "twitter4j-core" % "4.0.6",
"org.twitter4j" % "twitter4j-stream" % "4.0.6",
"org.apache.bahir" %% "spark-streaming-twitter" % "2.4.0" // depends on twitter4j-* version 4.0.6
),
run / fork := true,
run / javaOptions ++= Seq("-Xmx8g", "-Djdk.tls.trustNameService=true", "-Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true")
)
// QAS module
lazy val qas = (project in file("qas"))
.dependsOn(tok)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.qas.Indexer"),
assemblyJarName in assembly := "qas.jar",
libraryDependencies ++= Seq(
"org.elasticsearch.client" % "elasticsearch-rest-high-level-client" % "7.1.1",
"org.json4s" %% "json4s-native" % "3.5.3", // should use version 3.5.3 to fix a bug
"org.json4s" %% "json4s-jackson" % "3.5.3",
"org.scalaj" %% "scalaj-http" % "2.4.2",
"com.typesafe.akka" %% "akka-actor" % "2.5.27",
"com.typesafe.akka" %% "akka-http" % "10.1.11",
"com.typesafe.akka" %% "akka-stream" % "2.5.27",
"com.typesafe.akka" %% "akka-slf4j" % "2.5.27",
"org.slf4j" % "slf4j-simple" % "1.7.16",
"de.heikoseeberger" %% "akka-http-jackson" % "1.28.0"
),
run / fork := true,
run / javaOptions ++= Seq("-Xmx8g", "-Djdk.tls.trustNameService=true", "-Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true")
)
// Neural language model with RNN and Transformers
lazy val nlm = (project in file("nlm"))
.dependsOn(tok, biz)
.settings(
commonSettings,
mainClass in assembly := Some("vlp.nlm.LanguageModel"),
assemblyJarName in assembly := "nlm.jar",
libraryDependencies ++= Seq(),
)
// Bitcoin assignments
lazy val btc = (project in file("btc"))
.settings(
commonSettings,
mainClass in assembly := Some("vlp.btc.Main"),
assemblyJarName in assembly := "btc.jar"
)
// DSA lecture notes
lazy val dsa = (project in file("dsa"))
.settings(
commonSettings,
mainClass in assembly := Some("vlp.dsa.Main"),
assemblyJarName in assembly := "dsa.jar"
)
// Aspect-based sentiment analysis (PoC)
lazy val asa = (project in file("asa"))
.settings(
commonSettings,
mainClass in assembly := Some("vlp.asa.Main"),
assemblyJarName in assembly := "asa.jar"
)
// Akka actor models
lazy val aka = (project in file("aka"))
.settings(
// commonSettings,
assemblyJarName in assembly := "aka.jar",
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-simple" % "1.7.36",
"com.typesafe.akka" %% "akka-actor-typed" % "2.6.19",
"com.typesafe.akka" %% "akka-actor-testkit-typed" % "2.6.19" % Test
)
)
// Fundamental RL model
lazy val frl = (project in file("frl"))
.settings(
assemblyJarName in assembly := "frl.jar",
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-simple" % "1.7.36",
"org.scalatest" %% "scalatest" % "3.1.1" % "test"
)
)