Skip to content

Commit

Permalink
Upgrade dependency versions
Browse files Browse the repository at this point in the history
Change-Id: I92f75844b8380740c853214efb8ca8f2add401c5
  • Loading branch information
frankfliu committed Mar 19, 2022
1 parent 7c8b322 commit ff240fa
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.IOException;
import java.nio.file.Path;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.csv.CSVFormat;

Expand Down Expand Up @@ -58,7 +59,7 @@ public void prepare(Progress progress) throws IOException {

Map<String, String> filter = new ConcurrentHashMap<>();
filter.put("dataset", datasetName);
Artifact artifact = mrl.match(filter);
Artifact artifact = Objects.requireNonNull(mrl.match(filter));
mrl.prepare(artifact, progress);

Path dir = mrl.getRepository().getResourceDirectory(artifact);
Expand Down Expand Up @@ -90,7 +91,7 @@ public static final class Builder extends CsvBuilder<AmazonReview.Builder> {
repository = BasicDatasets.REPOSITORY;
groupId = BasicDatasets.GROUP_ID;
artifactId = ARTIFACT_ID;
csvFormat = CSVFormat.TDF.withQuote(null).withHeader();
csvFormat = CSVFormat.TDF.builder().setQuote(null).setHeader().build();
datasetName = "us_Digital_Software";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,13 @@ protected NDList toNDList(NDManager manager, CSVRecord record, List<Feature> sel
int length = selected.size();
ByteBuffer bb = manager.allocateDirect(length * 4);
FloatBuffer buf = bb.asFloatBuffer();
int index = 0;
for (Feature feature : selected) {
String name = feature.getName();
float value = Float.parseFloat(record.get(name));
if (normalize) {
value = (value - mean.get(name)) / std.get(name);
}
buf.put(value);
++index;
}
buf.rewind();
return new NDList(manager.create(buf, new Shape(length)));
Expand Down Expand Up @@ -179,7 +177,13 @@ public static final class Builder extends CsvBuilder<Builder> {
groupId = BasicDatasets.GROUP_ID;
artifactId = ARTIFACT_ID;
usage = Usage.TRAIN;
csvFormat = CSVFormat.TDF.withHeader(COLUMNS).withIgnoreHeaderCase().withTrim();
csvFormat =
CSVFormat.TDF
.builder()
.setHeader(COLUMNS)
.setIgnoreHeaderCase(true)
.setTrim(true)
.build();
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ public static final class Builder extends CsvBuilder<Builder> {
artifactId = ARTIFACT_ID;
usage = Usage.TRAIN;
csvFormat =
CSVFormat.DEFAULT.withFirstRecordAsHeader().withIgnoreHeaderCase().withTrim();
CSVFormat.DEFAULT
.builder()
.setHeader()
.setSkipHeaderRecord(true)
.setIgnoreHeaderCase(true)
.setTrim(true)
.build();
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private static CsvDataset getDataset(
float paddingToken = tokenizer.getVocabulary().getIndex("[PAD]");
return CsvDataset.builder()
.optCsvUrl(amazonReview)
.setCsvFormat(CSVFormat.TDF.withQuote(null).withHeader())
.setCsvFormat(CSVFormat.TDF.builder().setQuote(null).setHeader().build())
.setSampling(arguments.getBatchSize(), true)
.addFeature(
new CsvDataset.Feature(
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ tokenizers_version=0.11.0
fasttext_version=0.9.2
xgboost_version=1.4.1

commons_cli_version=1.4
commons_cli_version=1.5.0
commons_compress_version=1.21
commons_csv_version=1.8
commons_csv_version=1.9.0
commons_logging_version=1.2
gson_version=2.8.9
jna_version=5.9.0
slf4j_version=1.7.32
log4j_slf4j_version=2.17.1
awssdk_version=2.17.109
gson_version=2.9.0
jna_version=5.10.0
slf4j_version=1.7.36
log4j_slf4j_version=2.17.2
awssdk_version=2.17.151
hadoop_version=3.3.1
javacpp_version=1.5.6
protobuf_version=3.19.2

antlr_version=4.9.2
antlr_version=4.9.3
testng_version=7.5
junit_version=4.13.2

0 comments on commit ff240fa

Please sign in to comment.