Skip to content

Commit

Permalink
Merge pull request #72 from abrami/uima-3
Browse files Browse the repository at this point in the history
Uima 3
  • Loading branch information
abrami authored Mar 7, 2024
2 parents 2d73942 + b663232 commit 7cef243
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/test/java/CorporaTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,17 @@ public void prepareJCas() throws ResourceInitializationException, CASException {

@ParameterizedTest
@DisplayName("Toxic")
@ValueSource(strings = {"ssharoff/genres", "cardiffnlp/tweet-topic-latest-multi", "classla/xlm-roberta-base-multilingual-text-genre-classifier", "chkla/parlbert-topic-german", "manifesto-project/manifestoberta-xlm-roberta-56policy-topics-context-2023-1-1"})
@ValueSource(strings = {"cardiffnlp/tweet-topic-latest-multi", "classla/xlm-roberta-base-multilingual-text-genre-classifier", "chkla/parlbert-topic-german", "ssharoff/genres", "manifesto-project/manifestoberta-xlm-roberta-56policy-topics-context-2023-1-1"})
public void testToxic(String sModel) throws Exception {

// composer.resetPipeline();
composer.resetPipeline();

try {
composer.add(
new DUUIDockerDriver.Component("docker.texttechnologylab.org/textimager-duui-spacy-single-de_core_news_sm:0.1.4")
.withImageFetching()
.withScale(1)
.build()
);
//
// composer.add(
Expand All @@ -95,13 +96,16 @@ public void testToxic(String sModel) throws Exception {
.withParameter("model_name", sModel)
// .withParameter("selection", "text")
.withParameter("selection", "de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Sentence")
.build()
);

composer.run(pCas);

JCasUtil.select(pCas, CategoryCoveredTagged.class).forEach(a -> {
System.out.println(a);
});
assert JCasUtil.select(pCas, CategoryCoveredTagged.class).stream().count() > 0;

// JCasUtil.select(pCas, CategoryCoveredTagged.class).forEach(a -> {
// System.out.println(a);
// });
} finally {
composer.shutdown();
}
Expand Down

0 comments on commit 7cef243

Please sign in to comment.