Skip to content

Commit

Permalink
Merge branch 'main' into refactoring/Upgrade-to-Spring-Boot-3
Browse files Browse the repository at this point in the history
* main: (110 commits)
  #4787 - When re-merging a document CASMetadata is not retained
  #4785 - Upgrade dependencies
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release inception-33.0-beta-1
  #4768 - Bulk curation
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release inception-33.0-beta-1
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release inception-32.1
  #4782 - Avoid duplicate key error when importing documents very rapidly
  #4780 - Optionally include example documents in project templates
  #4778 - Links and other active elements in PDFs interfere with annotation and should be disabled
  #4739 - Auto-merge on open document in curation mode
  #4774 - Ability to not reset curation when performing a manual merge (sidebar curation)
  #4772 - Repair to trim whitespace off annotations
  #4769 - Cannot export CAS RDF
  #4768 - Bulk curation
  #4766 - Add ID column to documents table in dev mode
  #4764 - No longer force-enable server-side timings when dev mode is disabled
  #4762 - Re-merging via the curation sidebar always uses the project settings instead of the dialog settings
  ...

% Conflicts:
%	inception/inception-dependencies/pom.xml
%	inception/inception-diam-editor/pom.xml
%	inception/inception-diam-editor/src/main/java/de/tudarmstadt/ukp/inception/diam/sidebar/DiamAnnotationBrowser.java
%	inception/inception-external-editor/src/main/java/de/tudarmstadt/ukp/inception/externaleditor/ExternalAnnotationEditorBase.java
%	inception/inception-remote/src/main/java/de/tudarmstadt/ukp/clarin/webanno/webapp/remoteapi/config/RemoteApiAutoConfiguration.java
%	inception/inception-search-core/src/main/java/de/tudarmstadt/ukp/inception/search/SearchServiceImpl.java
%	inception/inception-sharing/src/main/java/de/tudarmstadt/ukp/inception/sharing/config/InviteServiceAutoConfiguration.java
%	inception/inception-ui-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/annotation/detail/AnnotationDetailEditorPanel.java
%	inception/inception-ui-core/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/core/login/LoginPage.java
%	inception/inception-ui-curation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/ui/curation/config/CurationUIAutoConfiguration.java
%	inception/inception-ui-curation/src/main/java/de/tudarmstadt/ukp/inception/ui/curation/sidebar/config/CurationSidebarAutoConfiguration.java
%	inception/inception-ui-dashboard-activity/pom.xml
%	inception/inception-ui-kb/pom.xml
%	inception/inception-workload-dynamic/src/main/java/de/tudarmstadt/ukp/inception/workload/dynamic/annotation/DynamicWorkflowDocumentNavigationActionBarExtension.java
%	pom.xml
  • Loading branch information
reckart committed May 3, 2024
2 parents ffcbb1c + c58c0ba commit d96c29f
Show file tree
Hide file tree
Showing 742 changed files with 75,545 additions and 29,923 deletions.
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>33.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
22 changes: 11 additions & 11 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>33.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 @@ -94,15 +103,6 @@
<artifactId>dkpro-statistics-agreement</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
Expand All @@ -36,8 +37,7 @@ public class AgreementSummary

private final String type;
private final String feature;
private final boolean excludeIncomplete;
private final List<String> casGroupIds = new ArrayList<>();
private final Set<String> casGroupIds = new HashSet<>();

private final List<Double> agreements = new ArrayList<>();
private final Set<Object> categories = new LinkedHashSet<>();
Expand All @@ -52,43 +52,7 @@ public class AgreementSummary
private int pluralitySets;
private int relevantSetCount;
private int completeSetCount;

public AgreementSummary remap(Map<String, String> aMapping)
{
return new AgreementSummary(this, aMapping);
}

private AgreementSummary(AgreementSummary aSummary, Map<String, String> aMapping)
{
type = aSummary.type;
feature = aSummary.feature;
excludeIncomplete = aSummary.excludeIncomplete;

aSummary.casGroupIds.stream().map(aMapping::get).sorted().forEach(casGroupIds::add);

agreements.addAll(aSummary.agreements);
categories.addAll(aSummary.categories);

for (var e : aSummary.itemCounts.entrySet()) {
itemCounts.put(aMapping.get(e.getKey()), e.getValue());
}

for (var e : aSummary.nonNullContentCounts.entrySet()) {
nonNullContentCounts.put(aMapping.get(e.getKey()), e.getValue());
}

for (var e : aSummary.allNull.entrySet()) {
allNull.put(aMapping.get(e.getKey()), e.getValue());
}

empty = aSummary.empty;

incompleteSetsByPosition = aSummary.incompleteSetsByPosition;
incompleteSetsByLabel = aSummary.incompleteSetsByLabel;
pluralitySets = aSummary.pluralitySets;
relevantSetCount = aSummary.relevantSetCount;
completeSetCount = aSummary.completeSetCount;
}
private int usedSetCount;

public void merge(AgreementSummary aResult)
{
Expand All @@ -102,17 +66,7 @@ public void merge(AgreementSummary aResult)
+ feature + "] but encountered [" + aResult.feature + "]");
}

if (excludeIncomplete != aResult.excludeIncomplete) {
throw new IllegalArgumentException(
"All merged results must have the same excludeIncomplete [" + excludeIncomplete
+ "] but encountered [" + aResult.excludeIncomplete + "]");
}

if (!casGroupIds.equals(aResult.casGroupIds)) {
throw new IllegalArgumentException("All merged results must have the same casGroupIds "
+ casGroupIds + " but encountered " + aResult.casGroupIds);
}

casGroupIds.addAll(aResult.casGroupIds);
agreements.addAll(aResult.agreements);
categories.addAll(aResult.categories);

Expand Down Expand Up @@ -149,6 +103,10 @@ public void merge(AgreementSummary aResult)
if (completeSetCount >= 0 && aResult.completeSetCount >= 0) {
completeSetCount += aResult.completeSetCount;
}

if (usedSetCount >= 0 && aResult.usedSetCount >= 0) {
usedSetCount += aResult.usedSetCount;
}
}

public static AgreementSummary of(Serializable aResult)
Expand All @@ -165,6 +123,19 @@ public static AgreementSummary of(Serializable aResult)
"Unsupported result type: [" + aResult.getClass().getName() + "]");
}

public static AgreementSummary skipped(String aType, String aFeature)
{
return new AgreementSummary(aType, aFeature);
}

public AgreementSummary(String aType, String aFeature)
{
type = aType;
feature = aFeature;
agreements.add(Double.NaN);
empty = true;
}

public AgreementSummary(FullUnitizingAgreementResult aResult)
{
this((FullAgreementResult_ImplBase<?>) aResult);
Expand All @@ -173,6 +144,7 @@ public AgreementSummary(FullUnitizingAgreementResult aResult)
incompleteSetsByPosition = -1;
relevantSetCount = -1;
completeSetCount = -1;
usedSetCount = -1;
pluralitySets = -1;
}

Expand All @@ -183,16 +155,20 @@ public AgreementSummary(FullCodingAgreementResult aResult)
incompleteSetsByLabel = aResult.getIncompleteSetsByLabel().size();
incompleteSetsByPosition = aResult.getIncompleteSetsByPosition().size();
pluralitySets = aResult.getPluralitySets().size();
relevantSetCount = aResult.getRelevantSetCount();
completeSetCount = aResult.getCompleteSetCount();
relevantSetCount = aResult.getRelevantSets().size();
completeSetCount = aResult.getCompleteSets().size();

usedSetCount = completeSetCount;
if (!aResult.isExcludeIncomplete()) {
usedSetCount += incompleteSetsByLabel + incompleteSetsByPosition;
}
}

private AgreementSummary(FullAgreementResult_ImplBase<?> aResult)
{
type = aResult.getType();
feature = aResult.getFeature();
excludeIncomplete = aResult.isExcludeIncomplete();
aResult.casGroupIds.stream().sorted().forEach(casGroupIds::add);
casGroupIds.addAll(aResult.casGroupIds);
agreements.add(aResult.agreement);
aResult.getCategories().forEach(categories::add);
empty = aResult.isEmpty();
Expand All @@ -206,7 +182,7 @@ private AgreementSummary(FullAgreementResult_ImplBase<?> aResult)

public List<String> getCasGroupIds()
{
return casGroupIds;
return casGroupIds.stream().sorted().toList();
}

private DoubleStream usableAgreements()
Expand Down Expand Up @@ -241,11 +217,6 @@ public String getFeature()
return feature;
}

public boolean isExcludeIncomplete()
{
return excludeIncomplete;
}

public boolean isEmpty()
{
return empty;
Expand Down Expand Up @@ -295,4 +266,9 @@ public int getPluralitySets()
{
return pluralitySets;
}

public int getUsedSetCount()
{
return usedSetCount;
}
}
Loading

0 comments on commit d96c29f

Please sign in to comment.