Skip to content

Commit

Permalink
Merge branch 'main' into bugfix/4668-Rejecting-predictions-using-Apac…
Browse files Browse the repository at this point in the history
…he-Annotator-editor

* main: (330 commits)
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release inception-34.0
  No issue: Mention MS SQL and PosgreSQL as experimental DB options
  No issue: Fix versions after merge
  #5043 - Ability to specify token breaking zones when calling tokenizer
  #5064 - Project template for PHI annotation
  #5071 - Better document which layers are supported by which formats
  #5061 - Multiple synchronous recommenders only the last one wins
  #5064 - Project template for PHI annotation
  #5068 - Show annotation sidebar by default
  #5033 - Ability to configure recommenders interactively on the annotation page
  #5066 - Increase default number of rows for brat editors
  #5056 - Ability to configure additional languages for knowledge bases
  #4909 - Upgrade dependencies
  #5056 - Ability to configure additional languages for knowledge bases
  #4909 - Upgrade dependencies
  No issue: Actually, document-metadata doesn't seem to be experimental after all...
  No issue: Set version to 35.0-SNAPSHOT
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release inception-33.7
  ...
  • Loading branch information
reckart committed Oct 1, 2024
2 parents f1982b5 + 2f27d03 commit 9606617
Show file tree
Hide file tree
Showing 1,863 changed files with 230,369 additions and 49,461 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

# Make sure that these files are treated as binary so that newlines are preserved.
# overrides GIT's determination if a file is text or not
*.zip binary
*.gz binary
*.bin binary
*.dump binary
*.xcas binary
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,38 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
jdk: [17]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref }}

- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
cache: maven

- name: Set up cache date
run: echo "CACHE_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Cache Maven repository
id: maven-cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ env.CACHE_DATE }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn --no-transfer-progress -B clean verify --file pom.xml

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ dependency-reduced-pom.xml
**/src/main/ts/package.json
**/src/main/ts/package-lock.json
local/
.asciidoctorconfig.adoc
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pipeline {
script {
def mavenCommand = 'mvn ' +
params.extraMavenArguments +
' -B -Dmaven.test.failure.ignore=true -Pjacoco,full-tests clean verify javadoc:javadoc'
' -B -Dmaven.test.failure.ignore=true -Pjacoco clean verify javadoc:javadoc'

if (isUnix()) {
sh script: mavenCommand
Expand Down
2 changes: 1 addition & 1 deletion inception/inception-active-learning/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-app</artifactId>
<version>32.0-SNAPSHOT</version>
<version>35.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>inception-active-learning</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package de.tudarmstadt.ukp.inception.active.learning;

import static de.tudarmstadt.ukp.clarin.webanno.model.AnnotationDocumentStateChangeFlag.EXPLICIT_ANNOTATOR_USER_ACTION;
import static de.tudarmstadt.ukp.inception.recommendation.api.model.LearningRecordChangeLocation.AL_SIDEBAR;
import static de.tudarmstadt.ukp.inception.recommendation.api.model.LearningRecordUserAction.ACCEPTED;
import static de.tudarmstadt.ukp.inception.recommendation.api.model.LearningRecordUserAction.CORRECTED;
Expand Down Expand Up @@ -224,7 +225,8 @@ public void acceptSpanSuggestion(SourceDocument aDocument, User aDataOwner,
}

// Save CAS after annotation has been created
documentService.writeAnnotationCas(cas, aDocument, aDataOwner, true);
documentService.writeAnnotationCas(cas, aDocument, aDataOwner,
EXPLICIT_ANNOTATOR_USER_ACTION);

// Send an application event indicating if the user has accepted/skipped/corrected/rejected
// the suggestion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public class ActiveLearningRecommendationEventAdapter
implements EventLoggingAdapter<ActiveLearningRecommendationEvent>
{
@Override
public boolean accepts(Object aEvent)
public boolean accepts(Class<?> aEvent)
{
return aEvent instanceof ActiveLearningRecommendationEvent;
return ActiveLearningRecommendationEvent.class.isAssignableFrom(aEvent);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.stream.Collectors;

import de.tudarmstadt.ukp.inception.active.learning.config.ActiveLearningAutoConfiguration;
import de.tudarmstadt.ukp.inception.active.learning.event.ActiveLearningRecommendationEvent;
import de.tudarmstadt.ukp.inception.active.learning.event.ActiveLearningSuggestionOfferedEvent;
import de.tudarmstadt.ukp.inception.log.adapter.EventLoggingAdapter;
import de.tudarmstadt.ukp.inception.log.model.AnnotationDetails;
Expand All @@ -39,9 +38,9 @@ public class ActiveLearningSuggestionOfferedAdapter
implements EventLoggingAdapter<ActiveLearningSuggestionOfferedEvent>
{
@Override
public boolean accepts(Object aEvent)
public boolean accepts(Class<?> aEvent)
{
return aEvent instanceof ActiveLearningRecommendationEvent;
return ActiveLearningSuggestionOfferedEvent.class.isAssignableFrom(aEvent);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
import java.util.Optional;

import org.apache.uima.cas.CAS;
import org.apache.uima.cas.Feature;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.text.AnnotationFS;
import org.apache.uima.fit.util.CasUtil;
import org.apache.wicket.Component;
Expand Down Expand Up @@ -75,7 +73,7 @@
import de.tudarmstadt.ukp.clarin.webanno.model.ReorderableTag;
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
import de.tudarmstadt.ukp.clarin.webanno.security.UserDao;
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.AnnotationPage;
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.AnnotationPageBase2;
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.sidebar.AnnotationSidebar_ImplBase;
import de.tudarmstadt.ukp.inception.active.learning.ActiveLearningService;
import de.tudarmstadt.ukp.inception.active.learning.ActiveLearningServiceImpl;
Expand Down Expand Up @@ -182,7 +180,7 @@ public class ActiveLearningSidebar

private final WebMarkupContainer alMainContainer;

private AnnotationPage annotationPage;
private AnnotationPageBase2 annotationPage;
private BootstrapModalDialog dialog;
private FeatureEditor editor;
private Form<Void> recommendationForm;
Expand All @@ -199,11 +197,10 @@ enum FeatureDetailEditorUpdateFlag
KEEP_SELECTED_ANNOTATION_AND_VIEW, CLEAR_SELECTED_ANNOTATION_AND_JUMP_TO_SUGGESTION
}

public ActiveLearningSidebar(String aId, IModel<AnnotatorState> aModel,
AnnotationActionHandler aActionHandler, CasProvider aCasProvider,
AnnotationPage aAnnotationPage)
public ActiveLearningSidebar(String aId, AnnotationActionHandler aActionHandler,
CasProvider aCasProvider, AnnotationPageBase2 aAnnotationPage)
{
super(aId, aModel, aActionHandler, aCasProvider, aAnnotationPage);
super(aId, aActionHandler, aCasProvider, aAnnotationPage);

annotationPage = aAnnotationPage;

Expand Down Expand Up @@ -993,10 +990,11 @@ private void actionSelectHistoryItem(AjaxRequestTarget aTarget, LearningRecord a

private Optional<AnnotationFS> getMatchingAnnotation(CAS aCas, LearningRecord aRecord)
{
Type type = CasUtil.getType(aCas, alStateModel.getObject().getLayer().getName());
Feature feature = type.getFeatureByBaseName(aRecord.getAnnotationFeature().getName());
var type = CasUtil.getType(aCas, alStateModel.getObject().getLayer().getName());
var feature = type.getFeatureByBaseName(aRecord.getAnnotationFeature().getName());
return selectAt(aCas, type, aRecord.getOffsetBegin(), aRecord.getOffsetEnd()).stream()
.filter(fs -> aRecord.getAnnotation().equals(fs.getFeatureValueAsString(feature)))
.filter(fs -> Objects.equals(aRecord.getAnnotation(),
fs.getFeatureValueAsString(feature)))
.findFirst();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import de.tudarmstadt.ukp.clarin.webanno.api.casstorage.CasProvider;
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.AnnotationPage;
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.AnnotationPageBase2;
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.sidebar.AnnotationSidebarFactory_ImplBase;
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.sidebar.AnnotationSidebar_ImplBase;
import de.tudarmstadt.ukp.inception.active.learning.config.ActiveLearningAutoConfiguration;
Expand Down Expand Up @@ -80,11 +80,9 @@ public boolean applies(AnnotatorState aState)
}

@Override
public AnnotationSidebar_ImplBase create(String aId, IModel<AnnotatorState> aModel,
AnnotationActionHandler aActionHandler, CasProvider aCasProvider,
AnnotationPage aAnnotationPage)
public AnnotationSidebar_ImplBase create(String aId, AnnotationActionHandler aActionHandler,
CasProvider aCasProvider, AnnotationPageBase2 aAnnotationPage)
{
return new ActiveLearningSidebar(aId, aModel, aActionHandler, aCasProvider,
aAnnotationPage);
return new ActiveLearningSidebar(aId, aActionHandler, aCasProvider, aAnnotationPage);
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
de.tudarmstadt.ukp.inception.active.learning.config.ActiveLearningAutoConfiguration
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,21 @@
*/
package de.tudarmstadt.ukp.inception.recommendation.api.model;

import static java.util.Arrays.fill;
import static org.assertj.core.api.Assertions.assertThat;

import java.util.Arrays;

import org.junit.jupiter.api.Test;

public class LearningRecordTest
{

@Test
public void thatTokenTextIsTruncated()
{
char[] charArray = new char[300];
Arrays.fill(charArray, 'X');
String longTokenText = new String(charArray);
var charArray = new char[300];
fill(charArray, 'X');
var longTokenText = new String(charArray);

LearningRecord sut = new LearningRecord();
var sut = new LearningRecord();
sut.setTokenText(longTokenText);

assertThat(sut.getTokenText()).as("TokenText has been truncated").hasSize(255);
Expand Down
26 changes: 22 additions & 4 deletions inception/inception-agreement/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,25 @@
<parent>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-app</artifactId>
<version>32.0-SNAPSHOT</version>
<version>35.0-SNAPSHOT</version>
</parent>

<artifactId>inception-agreement</artifactId>
<name>INCEpTION - Core - Agreement</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
</dependency>

<dependency>
<groupId>org.apache.uima</groupId>
Expand Down Expand Up @@ -88,6 +97,10 @@
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-annotation-storage-api</artifactId>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-layer-docmetadata</artifactId>
</dependency>

<dependency>
<groupId>org.dkpro.statistics</groupId>
Expand Down Expand Up @@ -126,8 +139,8 @@
<artifactId>wicket-bootstrap-core</artifactId>
</dependency>
<dependency>
<groupId>com.googlecode.wicket-jquery-ui</groupId>
<artifactId>wicket-jquery-ui-core</artifactId>
<groupId>org.wicketstuff</groupId>
<artifactId>wicketstuff-jquery-ui-core</artifactId>
</dependency>
<dependency>
<groupId>org.wicketstuff</groupId>
Expand Down Expand Up @@ -160,6 +173,11 @@
<artifactId>dkpro-core-io-xmi-asl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-constraints</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.tudarmstadt.ukp.inception.app</groupId>
<artifactId>inception-io-webanno-tsv</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,34 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.tudarmstadt.ukp.clarin.webanno.agreement.measures.krippendorffalphaunitizing;
package de.tudarmstadt.ukp.clarin.webanno.agreement;

import java.io.Serializable;

import de.tudarmstadt.ukp.clarin.webanno.agreement.measures.DefaultAgreementTraits;
import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature;

public class KrippendorffAlphaUnitizingAgreementTraits
extends DefaultAgreementTraits
public class AgreementResult_ImplBase
implements Serializable
{
private static final long serialVersionUID = -3843837791046164173L;
private static final long serialVersionUID = -342895455350245379L;

private final AnnotationFeature feature;
private final DefaultAgreementTraits traits;

private boolean excludeIncomplete;
public AgreementResult_ImplBase(AnnotationFeature aFeature, DefaultAgreementTraits aTraits)
{
feature = aFeature;
traits = aTraits;
}

public boolean isExcludeIncomplete()
public AnnotationFeature getFeature()
{
return excludeIncomplete;
return feature;
}

public void setExcludeIncomplete(boolean aExcludeIncomplete)
public DefaultAgreementTraits getTraits()
{
excludeIncomplete = aExcludeIncomplete;
return traits;
}
}
Loading

0 comments on commit 9606617

Please sign in to comment.