Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#448 Update dependencies #449

Merged
merged 5 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ public class TkSvmLightBooleanOutcomeClassifierBuilder
extends
TreeKernelSvmBooleanOutcomeClassifierBuilder<TreeKernelSvmBooleanOutcomeClassifier>{

static Logger logger = UIMAFramework.getLogger(TkSvmLightBooleanOutcomeClassifierBuilder.class);
static final Logger logger = UIMAFramework.getLogger(TkSvmLightBooleanOutcomeClassifierBuilder.class);

public static String COMMAND_ARGUMENT = "--executable";
public static final String COMMAND_ARGUMENT = "--executable";

/**
* Train a SVMTK classifier. Assumes the executable name is "tk_svm_learn". Note: this is public
Expand Down Expand Up @@ -90,7 +90,8 @@ public static void train(String filePath, String[] args) throws Exception {
process.waitFor();
}

public File getTrainingDataFile(File dir) {
@Override
public File getTrainingDataFile(File dir) {
return new File(dir, "training-data.svmlight");
}

Expand All @@ -107,7 +108,8 @@ private File getModelFile(File dir) {
* The arguments to be used by the tk_svm_classify command. Note: -t 5 is used to specify
* the use of Tree Kernels.
*/
public void trainClassifier(File dir, String... args) throws Exception {
@Override
public void trainClassifier(File dir, String... args) throws Exception {
File trainingDataFile = (dir.isDirectory() ? getTrainingDataFile(dir) : dir);
train(trainingDataFile.getPath(), args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.cleartk.test.util.DefaultTestBase;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import com.google.common.collect.Lists;
Expand Down Expand Up @@ -220,7 +219,6 @@ public void testTreeFeatures() throws Exception {
}
}

@Ignore
@Test
public void testTKSVMlight() throws Exception {
this.assumeTestsEnabled(COMMON_TESTS_PROPERTY_VALUE, TK_SVMLIGHT_TESTS_PROPERTY_VALUE);
Expand Down Expand Up @@ -265,7 +263,6 @@ public void testTKSVMlight() throws Exception {
}
}

@Ignore
@Test
public void testOVATKSVMlight() throws Exception {
this.assumeTestsEnabled(COMMON_TESTS_PROPERTY_VALUE, TK_SVMLIGHT_TESTS_PROPERTY_VALUE);
Expand Down
70 changes: 41 additions & 29 deletions cleartk-ml/pom.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,43 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cleartk-ml</artifactId>
<packaging>jar</packaging>
<name>ClearTK ML</name>
<description>ClearTK machine learning library and interfaces</description>
<parent>
<artifactId>cleartk</artifactId>
<groupId>org.cleartk</groupId>
<version>2.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-util</artifactId>
</dependency>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cleartk-ml</artifactId>
<packaging>jar</packaging>
<name>ClearTK ML</name>
<description>ClearTK machine learning library and interfaces</description>
<parent>
<artifactId>cleartk</artifactId>
<groupId>org.cleartk</groupId>
<version>2.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-util</artifactId>
</dependency>

<!-- test only -->
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-test-util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-document-annotation</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-test-util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.uima</groupId>
<artifactId>uimaj-document-annotation</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
package org.cleartk.ml.jar;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertTrue;

import java.io.File;
Expand All @@ -37,7 +38,6 @@
import org.cleartk.ml.test.DefaultStringTestDataWriterFactory;
import org.cleartk.ml.test.StringTestDataWriter;
import org.cleartk.test.util.DefaultTestBase;
import org.junit.Assert;
import org.junit.Test;

/**
Expand All @@ -61,7 +61,8 @@ public void testManifest() throws Throwable {
dataWriter.finish();
File manifestFile = new File(outputDirectory, "MANIFEST.MF");
String actualManifest = FileUtils.file2String(manifestFile);
Assert.assertEquals(expectedManifest, actualManifest.replaceAll("\r", "").trim());

assertThat(actualManifest).isEqualToIgnoringWhitespace(expectedManifest);
}

@Test
Expand All @@ -75,7 +76,5 @@ public void testFinish() throws Throwable {
DataWriter<String> dataWriter = factory.createDataWriter();
dataWriter.finish();
assertTrue(new File(outputDirectory, FeaturesEncoder_ImplBase.ENCODERS_FILE_NAME).exists());

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

package org.cleartk.ml.viterbi;

import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.contentOf;
import static org.junit.Assert.assertTrue;

import java.io.File;
Expand All @@ -33,7 +36,6 @@
import java.util.List;
import java.util.Set;

import org.apache.commons.io.FileUtils;
import org.apache.uima.analysis_engine.AnalysisEngine;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
Expand All @@ -52,7 +54,6 @@
import org.cleartk.test.util.DefaultTestBase;
import org.cleartk.test.util.type.Sentence;
import org.cleartk.test.util.type.Token;
import org.junit.Assert;
import org.junit.Test;

/**
Expand Down Expand Up @@ -118,8 +119,8 @@ public void testConsumeAll() throws Exception {
+ "classifierBuilderClass: org.cleartk.ml.viterbi.ViterbiClassifierBuilde\n" + " r";

File manifestFile = new File(outputDirectoryName, "MANIFEST.MF");
String actualManifest = FileUtils.readFileToString(manifestFile);
Assert.assertEquals(expectedManifest, actualManifest.replaceAll("\r", "").trim());
String actualManifest = contentOf(manifestFile, UTF_8);
assertThat(actualManifest).isEqualToIgnoringWhitespace(expectedManifest);

ViterbiClassifierBuilder<String> builder = new ViterbiClassifierBuilder<String>();
File delegatedOutputDirectory = builder.getDelegatedModelDirectory(outputDirectory);
Expand Down Expand Up @@ -166,5 +167,4 @@ private void testFeatures(String trainingDataLine, String... expectedFeatures) {
assertTrue(features.contains(expectedFeature));
}
}

}
180 changes: 94 additions & 86 deletions cleartk-timeml/pom.xml
Original file line number Diff line number Diff line change
@@ -1,89 +1,97 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cleartk-timeml</artifactId>
<packaging>jar</packaging>
<name>ClearTK TimeML</name>
<description>ClearTK annotators for temporal information extraction</description>
<parent>
<artifactId>cleartk</artifactId>
<groupId>org.cleartk</groupId>
<version>2.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>com.lexicalscope.jewelcli</groupId>
<artifactId>jewelcli</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-util</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-eval</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-ml</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-ml-liblinear</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-type-system</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-feature</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-corpus</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-token</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-snowball</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-opennlp-tools</artifactId>
</dependency>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>cleartk-timeml</artifactId>
<packaging>jar</packaging>
<name>ClearTK TimeML</name>
<description>ClearTK annotators for temporal information extraction</description>
<parent>
<artifactId>cleartk</artifactId>
<groupId>org.cleartk</groupId>
<version>2.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>com.lexicalscope.jewelcli</groupId>
<artifactId>jewelcli</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-util</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-eval</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-ml</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-ml-liblinear</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-type-system</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-feature</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-corpus</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-token</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-snowball</artifactId>
</dependency>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-opennlp-tools</artifactId>
</dependency>

<!-- test only -->
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-test-util</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<dependency>
<groupId>org.cleartk</groupId>
<artifactId>cleartk-test-util</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-assertj3</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- increase max memory for tests since models must be loaded -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx512m</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.cleartk.timeml.TimeMLAnnotate</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx512m</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.cleartk.timeml.TimeMLAnnotate</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading