Compare commits
14 Commits
4.438.0-RE
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdd2b954fe | ||
|
|
2d3a048487 | ||
|
|
518c38c2e9 | ||
|
|
21097a6419 | ||
|
|
c8dd167606 | ||
|
|
9bd5577986 | ||
|
|
c1990ef4aa | ||
|
|
3dfa05bd67 | ||
|
|
22b2a6474b | ||
|
|
cf21b75f2e | ||
|
|
a1e6361c3e | ||
|
|
3c2db795c8 | ||
|
|
ef1810b658 | ||
|
|
26025a5621 |
@ -377,6 +377,7 @@ public class DocumentTree {
|
|||||||
}
|
}
|
||||||
|
|
||||||
entity.computeRelations();
|
entity.computeRelations();
|
||||||
|
entity.notifyEntityInserted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public class TextEntity implements IEntity {
|
|||||||
|
|
||||||
TextRange textRange;
|
TextRange textRange;
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
List<TextRange> duplicateTextRanges = new ArrayList<>();
|
Set<TextRange> duplicateTextRanges = new HashSet<>();
|
||||||
String type; // TODO: make final once ManualChangesApplicationService::recategorize is deleted
|
String type; // TODO: make final once ManualChangesApplicationService::recategorize is deleted
|
||||||
final EntityType entityType;
|
final EntityType entityType;
|
||||||
|
|
||||||
@ -215,22 +215,20 @@ public class TextEntity implements IEntity {
|
|||||||
return textEntity.contains(this);
|
return textEntity.contains(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean contains(TextEntity textEntity) {
|
public boolean contains(TextEntity textEntity) {
|
||||||
|
|
||||||
if (this.textRange.contains(textEntity.getTextRange())) {
|
if (this.textRange.contains(textEntity.getTextRange())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TextRange> textEntityDuplicateRanges = textEntity.getDuplicateTextRanges();
|
Set<TextRange> textEntityDuplicateRanges = textEntity.getDuplicateTextRanges();
|
||||||
// use optimized indexed loops for extra performance boost
|
|
||||||
for (int i = 0, duplicateTextRangesSize = duplicateTextRanges.size(); i < duplicateTextRangesSize; i++) {
|
for (TextRange duplicateTextRange : this.duplicateTextRanges) {
|
||||||
TextRange duplicateTextRange = duplicateTextRanges.get(i);
|
|
||||||
if (duplicateTextRange.contains(textEntity.getTextRange())) {
|
if (duplicateTextRange.contains(textEntity.getTextRange())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
for (int j = 0, textEntityDuplicateRangesSize = textEntityDuplicateRanges.size(); j < textEntityDuplicateRangesSize; j++) {
|
|
||||||
TextRange otherRange = textEntityDuplicateRanges.get(j);
|
for (TextRange otherRange : textEntityDuplicateRanges) {
|
||||||
if (duplicateTextRange.contains(otherRange)) {
|
if (duplicateTextRange.contains(otherRange)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -241,6 +239,7 @@ public class TextEntity implements IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean intersects(TextEntity textEntity) {
|
public boolean intersects(TextEntity textEntity) {
|
||||||
|
|
||||||
return this.textRange.intersects(textEntity.getTextRange()) //
|
return this.textRange.intersects(textEntity.getTextRange()) //
|
||||||
|
|||||||
@ -16,7 +16,7 @@ val layoutParserVersion = "0.193.0"
|
|||||||
val jacksonVersion = "2.15.2"
|
val jacksonVersion = "2.15.2"
|
||||||
val droolsVersion = "9.44.0.Final"
|
val droolsVersion = "9.44.0.Final"
|
||||||
val pdfBoxVersion = "3.0.0"
|
val pdfBoxVersion = "3.0.0"
|
||||||
val persistenceServiceVersion = "2.639.0"
|
val persistenceServiceVersion = "2.641.0"
|
||||||
val llmServiceVersion = "1.20.0-RED10072.2"
|
val llmServiceVersion = "1.20.0-RED10072.2"
|
||||||
val springBootStarterVersion = "3.1.5"
|
val springBootStarterVersion = "3.1.5"
|
||||||
val springCloudVersion = "4.0.4"
|
val springCloudVersion = "4.0.4"
|
||||||
@ -77,8 +77,8 @@ dependencies {
|
|||||||
implementation("org.apache.tomcat:tomcat-websocket:${tomcatVersion}")
|
implementation("org.apache.tomcat:tomcat-websocket:${tomcatVersion}")
|
||||||
implementation("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
implementation("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
||||||
|
|
||||||
implementation("org.liquibase:liquibase-core:4.30.0") // Needed to be set explicit, otherwise spring dependency management sets it to 4.20.0
|
implementation("org.liquibase:liquibase-core:4.29.2") // Needed to be set explicit, otherwise spring dependency management sets it to 4.20.0
|
||||||
implementation("org.apache.commons:commons-lang3:3.13.0") // Needed for liquibase 4.30.0
|
implementation("org.liquibase.ext:liquibase-mongodb:4.29.2")
|
||||||
|
|
||||||
implementation("net.logstash.logback:logstash-logback-encoder:7.4")
|
implementation("net.logstash.logback:logstash-logback-encoder:7.4")
|
||||||
api("ch.qos.logback:logback-classic")
|
api("ch.qos.logback:logback-classic")
|
||||||
|
|||||||
@ -81,7 +81,6 @@ public class ManualChangesApplicationService {
|
|||||||
public void resizeEntityAndReinsert(TextEntity entityToBeResized, ManualResizeRedaction manualResizeRedaction) {
|
public void resizeEntityAndReinsert(TextEntity entityToBeResized, ManualResizeRedaction manualResizeRedaction) {
|
||||||
|
|
||||||
entityToBeResized.notifyEntityRemoved();
|
entityToBeResized.notifyEntityRemoved();
|
||||||
entityToBeResized.removeFromGraph();
|
|
||||||
|
|
||||||
PositionOnPage positionOnPageToBeResized = entityToBeResized.getPositionsOnPagePerPage()
|
PositionOnPage positionOnPageToBeResized = entityToBeResized.getPositionsOnPagePerPage()
|
||||||
.stream()
|
.stream()
|
||||||
@ -156,7 +155,7 @@ public class ManualChangesApplicationService {
|
|||||||
entityToBeResized.setTextRange(closestEntity.getTextRange());
|
entityToBeResized.setTextRange(closestEntity.getTextRange());
|
||||||
entityToBeResized.setTextAfter(closestEntity.getTextAfter());
|
entityToBeResized.setTextAfter(closestEntity.getTextAfter());
|
||||||
entityToBeResized.setTextBefore(closestEntity.getTextBefore());
|
entityToBeResized.setTextBefore(closestEntity.getTextBefore());
|
||||||
entityToBeResized.setDuplicateTextRanges(new ArrayList<>(closestEntity.getDuplicateTextRanges()));
|
entityToBeResized.setDuplicateTextRanges(new HashSet<>(closestEntity.getDuplicateTextRanges()));
|
||||||
entityToBeResized.setValue(closestEntity.getValue());
|
entityToBeResized.setValue(closestEntity.getValue());
|
||||||
entityToBeResized.setPages(newIntersectingPages);
|
entityToBeResized.setPages(newIntersectingPages);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -985,17 +985,18 @@ public class EntityCreationService {
|
|||||||
return Optional.empty(); // Entity has been recategorized and should not be created at all.
|
return Optional.empty(); // Entity has been recategorized and should not be created at all.
|
||||||
}
|
}
|
||||||
TextEntity existingEntity = optionalTextEntity.get();
|
TextEntity existingEntity = optionalTextEntity.get();
|
||||||
if (existingEntity.getTextRange().equals(textRange)) {
|
if (existingEntity.getTextRange().equals(trimmedTextRange)) {
|
||||||
return optionalTextEntity; // exactly the same entity, return directly
|
return optionalTextEntity; // exactly the same entity, return directly
|
||||||
}
|
}
|
||||||
if (!existingEntity.resized()) {
|
if (!existingEntity.resized()) {
|
||||||
addDuplicateEntityToGraph(existingEntity, textRange, node);
|
addDuplicateEntityToGraph(existingEntity, trimmedTextRange, node);
|
||||||
return optionalTextEntity; // If Entity has not been resized, insert as duplicate at appropriate position
|
return optionalTextEntity; // If Entity has not been resized, insert as duplicate at appropriate position
|
||||||
}
|
}
|
||||||
return Optional.empty(); // Entity has been resized, if there are duplicates they should be treated there
|
return Optional.empty(); // Entity has been resized, if there are duplicates they should be treated there
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addListenerToEntity(entity);
|
||||||
node.getDocumentTree().addEntityToGraph(entity);
|
node.getDocumentTree().addEntityToGraph(entity);
|
||||||
insertToKieSession(entity);
|
|
||||||
|
|
||||||
entity.addEngines(engines);
|
entity.addEngines(engines);
|
||||||
|
|
||||||
@ -1421,8 +1422,8 @@ public class EntityCreationService {
|
|||||||
.ifPresent(e -> addDuplicateEntityToGraph(e, entity.getTextRange(), node));
|
.ifPresent(e -> addDuplicateEntityToGraph(e, entity.getTextRange(), node));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
addListenerToEntity(entity);
|
||||||
documentTree.addEntityToGraph(entity);
|
documentTree.addEntityToGraph(entity);
|
||||||
insertToKieSession(entity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1474,18 +1475,13 @@ public class EntityCreationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void addListenerToEntity(TextEntity textEntity) {
|
||||||
|
|
||||||
/**
|
|
||||||
* Inserts a text entity into the kieSession for further processing.
|
|
||||||
*
|
|
||||||
* @param textEntity The merged text entity to insert.
|
|
||||||
*/
|
|
||||||
public void insertToKieSession(TextEntity textEntity) {
|
|
||||||
|
|
||||||
if(kieSessionUpdater != null) {
|
if(kieSessionUpdater != null) {
|
||||||
kieSessionUpdater.insert(textEntity);
|
textEntity.addEntityEventListener(kieSessionUpdater);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,12 +14,15 @@ import org.springframework.stereotype.Service;
|
|||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.Engine;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.Engine;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.imported.ImportedRedactions;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.imported.ImportedRedactions;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactions;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ManualRedactions;
|
||||||
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.Rectangle;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.BaseAnnotation;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.BaseAnnotation;
|
||||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.IdRemoval;
|
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.entitymapped.IdRemoval;
|
||||||
import com.iqser.red.service.redaction.v1.server.RedactionServiceSettings;
|
import com.iqser.red.service.redaction.v1.server.RedactionServiceSettings;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.PrecursorEntity;
|
import com.iqser.red.service.redaction.v1.server.model.PrecursorEntity;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.document.entity.EntityType;
|
import com.iqser.red.service.redaction.v1.server.model.document.entity.EntityType;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity;
|
import com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity;
|
||||||
|
import com.iqser.red.service.redaction.v1.server.model.document.nodes.Document;
|
||||||
|
import com.iqser.red.service.redaction.v1.server.model.document.nodes.Page;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.document.nodes.SemanticNode;
|
import com.iqser.red.service.redaction.v1.server.model.document.nodes.SemanticNode;
|
||||||
import com.iqser.red.service.redaction.v1.server.service.DictionaryService;
|
import com.iqser.red.service.redaction.v1.server.service.DictionaryService;
|
||||||
import com.iqser.red.service.redaction.v1.server.service.EntityFindingUtility;
|
import com.iqser.red.service.redaction.v1.server.service.EntityFindingUtility;
|
||||||
@ -41,9 +44,14 @@ public class EntityFromPrecursorCreationService {
|
|||||||
RedactionServiceSettings settings;
|
RedactionServiceSettings settings;
|
||||||
|
|
||||||
|
|
||||||
public List<PrecursorEntity> createEntitiesIfFoundAndReturnNotFoundEntries(ManualRedactions manualRedactions, SemanticNode node, String dossierTemplateId) {
|
public List<PrecursorEntity> createEntitiesIfFoundAndReturnNotFoundEntries(ManualRedactions manualRedactions, Document document, String dossierTemplateId) {
|
||||||
|
|
||||||
|
Set<Integer> pageNumbers = document.getPages()
|
||||||
|
.stream()
|
||||||
|
.map(Page::getNumber)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
Set<IdRemoval> idRemovals = manualRedactions.getIdsToRemove();
|
Set<IdRemoval> idRemovals = manualRedactions.getIdsToRemove();
|
||||||
|
|
||||||
List<PrecursorEntity> manualEntities = manualRedactions.getEntriesToAdd()
|
List<PrecursorEntity> manualEntities = manualRedactions.getEntriesToAdd()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(BaseAnnotation::isLocal)
|
.filter(BaseAnnotation::isLocal)
|
||||||
@ -52,6 +60,10 @@ public class EntityFromPrecursorCreationService {
|
|||||||
.filter(idRemoval -> idRemoval.getRequestDate().isAfter(manualRedactionEntry.getRequestDate()))
|
.filter(idRemoval -> idRemoval.getRequestDate().isAfter(manualRedactionEntry.getRequestDate()))
|
||||||
.findAny()//
|
.findAny()//
|
||||||
.isEmpty())
|
.isEmpty())
|
||||||
|
.filter(manualRedactionEntry -> manualRedactionEntry.getPositions()
|
||||||
|
.stream()
|
||||||
|
.map(Rectangle::getPage)
|
||||||
|
.allMatch(pageNumbers::contains))
|
||||||
.map(manualRedactionEntry -> //
|
.map(manualRedactionEntry -> //
|
||||||
PrecursorEntity.fromManualRedactionEntry(manualRedactionEntry, dictionaryService.isHint(manualRedactionEntry.getType(), dossierTemplateId)))
|
PrecursorEntity.fromManualRedactionEntry(manualRedactionEntry, dictionaryService.isHint(manualRedactionEntry.getType(), dossierTemplateId)))
|
||||||
.peek(manualEntity -> {
|
.peek(manualEntity -> {
|
||||||
@ -62,7 +74,7 @@ public class EntityFromPrecursorCreationService {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.toList();
|
.toList();
|
||||||
return toTextEntity(manualEntities, node);
|
return toTextEntity(manualEntities, document);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -140,7 +152,7 @@ public class EntityFromPrecursorCreationService {
|
|||||||
}
|
}
|
||||||
correctEntity.setDeepestFullyContainingNode(closestEntity.getDeepestFullyContainingNode());
|
correctEntity.setDeepestFullyContainingNode(closestEntity.getDeepestFullyContainingNode());
|
||||||
correctEntity.setIntersectingNodes(new ArrayList<>(closestEntity.getIntersectingNodes()));
|
correctEntity.setIntersectingNodes(new ArrayList<>(closestEntity.getIntersectingNodes()));
|
||||||
correctEntity.setDuplicateTextRanges(new ArrayList<>(closestEntity.getDuplicateTextRanges()));
|
correctEntity.setDuplicateTextRanges(new HashSet<>(closestEntity.getDuplicateTextRanges()));
|
||||||
correctEntity.setPages(new HashSet<>(closestEntity.getPages()));
|
correctEntity.setPages(new HashSet<>(closestEntity.getPages()));
|
||||||
|
|
||||||
correctEntity.setValue(closestEntity.getValue());
|
correctEntity.setValue(closestEntity.getValue());
|
||||||
|
|||||||
@ -28,7 +28,7 @@ import com.iqser.red.service.redaction.v1.server.logger.RulesLogger;
|
|||||||
import com.iqser.red.service.redaction.v1.server.logger.TrackingAgendaEventListener;
|
import com.iqser.red.service.redaction.v1.server.logger.TrackingAgendaEventListener;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.NerEntities;
|
import com.iqser.red.service.redaction.v1.server.model.NerEntities;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.dictionary.Dictionary;
|
import com.iqser.red.service.redaction.v1.server.model.dictionary.Dictionary;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.document.entity.IEntity;
|
import com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.document.nodes.Document;
|
import com.iqser.red.service.redaction.v1.server.model.document.nodes.Document;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.document.nodes.Image;
|
import com.iqser.red.service.redaction.v1.server.model.document.nodes.Image;
|
||||||
import com.iqser.red.service.redaction.v1.server.model.document.nodes.SemanticNode;
|
import com.iqser.red.service.redaction.v1.server.model.document.nodes.SemanticNode;
|
||||||
@ -121,14 +121,17 @@ public class EntityDroolsExecutionService {
|
|||||||
.flatMap(SemanticNode::streamAllSubNodes)
|
.flatMap(SemanticNode::streamAllSubNodes)
|
||||||
.forEach(semanticNode -> {
|
.forEach(semanticNode -> {
|
||||||
if (semanticNode instanceof Image image) {
|
if (semanticNode instanceof Image image) {
|
||||||
kieSessionUpdater.insert(image);
|
image.addEntityEventListener(kieSessionUpdater);
|
||||||
|
image.notifyEntityInserted();
|
||||||
} else {
|
} else {
|
||||||
kieSession.insert(semanticNode);
|
kieSession.insert(semanticNode);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getEntities()
|
for (TextEntity textEntity : document.getEntities()) {
|
||||||
.forEach(kieSessionUpdater::insert);
|
textEntity.addEntityEventListener(kieSessionUpdater);
|
||||||
|
textEntity.notifyEntityInserted();
|
||||||
|
}
|
||||||
|
|
||||||
document.getPages()
|
document.getPages()
|
||||||
.forEach(kieSession::insert);
|
.forEach(kieSession::insert);
|
||||||
|
|||||||
@ -24,13 +24,6 @@ public class KieSessionUpdater implements EntityEventListener {
|
|||||||
KieSession kieSession;
|
KieSession kieSession;
|
||||||
|
|
||||||
|
|
||||||
public void insert(IEntity entity) {
|
|
||||||
|
|
||||||
entity.addEntityEventListener(this);
|
|
||||||
onEntityInserted(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntityInserted(IEntity entity) {
|
public void onEntityInserted(IEntity entity) {
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,8 @@ fforesight:
|
|||||||
ignored-endpoints: [ '/redaction-gateway-v1', '/actuator/health/**',"/api/rules-logging/rulesocket","/api/rules-logging/rulesocket/**", '/redaction-gateway-v1/async/download/with-ott/**',
|
ignored-endpoints: [ '/redaction-gateway-v1', '/actuator/health/**',"/api/rules-logging/rulesocket","/api/rules-logging/rulesocket/**", '/redaction-gateway-v1/async/download/with-ott/**',
|
||||||
'/internal-api/**', '/redaction-gateway-v1/docs/swagger-ui', '/rules/test',
|
'/internal-api/**', '/redaction-gateway-v1/docs/swagger-ui', '/rules/test',
|
||||||
'/redaction-gateway-v1/docs/**','/redaction-gateway-v1/docs',
|
'/redaction-gateway-v1/docs/**','/redaction-gateway-v1/docs',
|
||||||
'/api', '/api/','/api/docs/**','/api/docs','/api/docs/swagger-ui' ]
|
'/api', '/api/','/api/docs/**','/api/docs','/api/docs/swagger-ui',
|
||||||
|
'/actuator/prometheus' ]
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
|
|||||||
@ -1584,6 +1584,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.7
|
// Rule unit: X.7
|
||||||
rule "X.7.0: Remove all images"
|
rule "X.7.0: Remove all images"
|
||||||
salience 512
|
salience 512
|
||||||
|
|||||||
@ -243,7 +243,7 @@ public abstract class AbstractRedactionIntegrationTest {
|
|||||||
public static void init() {
|
public static void init() {
|
||||||
|
|
||||||
synchronized (PDFNet.class) {
|
synchronized (PDFNet.class) {
|
||||||
PDFNet.initialize("demo:1650351709282:7bd235e003000000004ec28a6743e1163a085e2115de2536ab6e2cfe5a");
|
PDFNet.initialize("demo:admin@knecon.com:7ed45ca80200000000c1e1765b94afccf5bbc0cb8582fd932c602e286a");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -169,7 +169,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
public static void init() {
|
public static void init() {
|
||||||
|
|
||||||
synchronized (PDFNet.class) {
|
synchronized (PDFNet.class) {
|
||||||
PDFNet.initialize("demo:1650351709282:7bd235e003000000004ec28a6743e1163a085e2115de2536ab6e2cfe5a");
|
PDFNet.initialize("demo:admin@knecon.com:7ed45ca80200000000c1e1765b94afccf5bbc0cb8582fd932c602e286a");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -261,7 +261,6 @@ public class DocumineFloraTest extends AbstractRedactionIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Disabled
|
|
||||||
@Test
|
@Test
|
||||||
public void testDoseMortalityExtraction() {
|
public void testDoseMortalityExtraction() {
|
||||||
|
|
||||||
|
|||||||
@ -1315,6 +1315,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
// Rule unit: X.3
|
||||||
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
||||||
salience 64
|
salience 64
|
||||||
when
|
when
|
||||||
@ -1384,6 +1385,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -2079,6 +2079,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
// Rule unit: X.3
|
||||||
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
||||||
salience 64
|
salience 64
|
||||||
when
|
when
|
||||||
@ -2148,6 +2149,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -1451,6 +1451,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
// Rule unit: X.3
|
||||||
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
||||||
salience 64
|
salience 64
|
||||||
when
|
when
|
||||||
@ -1520,6 +1521,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.7
|
// Rule unit: X.7
|
||||||
rule "X.7.0: Remove all images"
|
rule "X.7.0: Remove all images"
|
||||||
salience 512
|
salience 512
|
||||||
|
|||||||
@ -1042,6 +1042,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
// Rule unit: X.3
|
||||||
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
||||||
salience 64
|
salience 64
|
||||||
when
|
when
|
||||||
@ -1111,6 +1112,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -363,6 +363,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
// Rule unit: X.3
|
||||||
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
||||||
salience 64
|
salience 64
|
||||||
when
|
when
|
||||||
@ -432,6 +433,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -1408,6 +1408,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -423,6 +423,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
// Rule unit: X.3
|
||||||
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
||||||
salience 64
|
salience 64
|
||||||
when
|
when
|
||||||
@ -492,6 +493,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -513,6 +513,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
// Rule unit: X.3
|
||||||
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
||||||
salience 64
|
salience 64
|
||||||
when
|
when
|
||||||
@ -582,6 +583,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -396,38 +396,6 @@ rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
|
|||||||
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
|
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
|
||||||
end
|
end
|
||||||
|
|
||||||
rule "X.2.0: Remove Entity of type ENTITY when contained by FALSE_POSITIVE"
|
|
||||||
salience 64
|
|
||||||
when
|
|
||||||
$containment: Containment(
|
|
||||||
$container: container,
|
|
||||||
$contained: contained,
|
|
||||||
$container.entityType == EntityType.FALSE_POSITIVE,
|
|
||||||
$container.active(),
|
|
||||||
$contained.entityType == EntityType.ENTITY,
|
|
||||||
$contained.type() == $container.type(),
|
|
||||||
!$contained.hasManualChanges()
|
|
||||||
)
|
|
||||||
then
|
|
||||||
$contained.remove("X.2.0", "remove Entity of type ENTITY when contained by FALSE_POSITIVE");
|
|
||||||
end
|
|
||||||
|
|
||||||
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
|
||||||
salience 64
|
|
||||||
when
|
|
||||||
$containment: Containment(
|
|
||||||
$container: container,
|
|
||||||
$contained: contained,
|
|
||||||
$container.entityType == EntityType.FALSE_POSITIVE,
|
|
||||||
$container.active(),
|
|
||||||
$contained.entityType == EntityType.HINT,
|
|
||||||
$contained.type() == $container.type(),
|
|
||||||
!$contained.hasManualChanges()
|
|
||||||
)
|
|
||||||
then
|
|
||||||
$contained.remove("X.2.1", "remove Entity of type HINT when contained by FALSE_POSITIVE");
|
|
||||||
end
|
|
||||||
|
|
||||||
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
||||||
salience 64
|
salience 64
|
||||||
when
|
when
|
||||||
@ -445,6 +413,7 @@ rule "X.2.1: Remove Entity of type HINT when contained by FALSE_POSITIVE"
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
// Rule unit: X.3
|
||||||
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
rule "X.3.0: Remove RECOMMENDATION Contained by FALSE_RECOMMENDATION"
|
||||||
salience 64
|
salience 64
|
||||||
when
|
when
|
||||||
@ -514,6 +483,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -995,6 +995,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -2187,6 +2187,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.6
|
// Rule unit: X.6
|
||||||
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
rule "X.6.0: Remove Lower Rank Entity Contained by ENTITY or HINT"
|
||||||
salience 32
|
salience 32
|
||||||
|
|||||||
@ -1589,6 +1589,23 @@ rule "X.5.1: Remove Entity of type RECOMMENDATION when contained by RECOMMENDATI
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
rule "X.5.2: Remove Entity of type RECOMMENDATION when contained by ENTITY of same type"
|
||||||
|
salience 256
|
||||||
|
when
|
||||||
|
$intersection: Containment(
|
||||||
|
$container: container,
|
||||||
|
$contained: contained,
|
||||||
|
($container.entityType == EntityType.ENTITY || $container.entityType == EntityType.HINT),
|
||||||
|
!$container.removed(),
|
||||||
|
$contained.entityType == EntityType.RECOMMENDATION,
|
||||||
|
$container.type() == $contained.type(),
|
||||||
|
!$contained.hasManualChanges()
|
||||||
|
)
|
||||||
|
then
|
||||||
|
$contained.remove("X.5.2", "remove Entity of type RECOMMENDATION when contained by ENTITY of same type");
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
// Rule unit: X.7
|
// Rule unit: X.7
|
||||||
rule "X.7.0: Remove all images"
|
rule "X.7.0: Remove all images"
|
||||||
salience 512
|
salience 512
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user