public class ImplicitRelationUtilities extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ImplicitRelationUtilities.DependentPath
Information about a dependent path.
|
Modifier and Type | Field and Description |
---|---|
static String |
CRLF
Platform independent newline String.
|
static String |
INDENT
Amount to indent when depicting layered information.
|
static String |
KEY_IMPLICITREL_ALLOWSELFRELATIONS
Implicit Entity relation rule setting indicating that self relations
(relations whose source and target are the same) should be created.
|
static String |
KEY_IMPLICITREL_FIRSTSOURCEONLY
Implicit Entity relation rule setting indicating only the first source
should be used.
|
static String |
KEY_IMPLICITREL_MAXSENTENCEDISTANCE
Implicit Entity relation rule setting indicating
the maximum sentence distance between source and target markings.
|
static String |
KEY_IMPLICITREL_SHORTESTDEPENDENTPATHTHRESHOLD
Implicit Entity relation rule setting indicating
the "shortest dependent path" threshold between source and target
within a single sentence.
|
Constructor and Description |
---|
ImplicitRelationUtilities(InformationExtraction ext,
List<InformationExtractionOutcomeMarking> markingsList)
Construct an ImplicitRelationUtilities, using the components of an extraction
in progress, before an InformationExtractionOutcome is created.
|
ImplicitRelationUtilities(InformationExtractionOutcome outcome)
Construct an ImplicitRelationUtilities, based on an
InformationExtractionOutcome that is either confirmed or unconfirmed.
|
Modifier and Type | Method and Description |
---|---|
List<InformationExtractionOutcomeMarkingRelation> |
createImplicitRelations()
Creates a set of marking relations based on the ImplicitEntityRelations
defined on the DomainSpecification implied during construction,
along with the markings specified (or implied) during construction.
|
void |
createLegalImplicitRelationsDocument()
Create the Legal Implicit Relation document that shows all of the possible
relations that could be generated if the ImplicitRelations defined
on the DomainSpecifcation were used.
|
void |
createLegalImplicitRelationsDocument(boolean writeToTemp)
Create the Legal Implicit Relation document that shows all of the possible
relations that could be generated if the ImplicitRelations defined
on the DomainSpecifcation were used.
|
static void |
createLegalImplicitRelationsDocument(InformationExtraction ext)
Create the Legal Implicit Relation document that shows all of the possible
relations that could be generated if the ImplicitRelations defined
on the DomainSpecifcation were used, based on the solved outcome of the specified
InformationExtraction.
|
static void |
createLegalImplicitRelationsDocument(InformationExtraction ext,
boolean writeToTemp)
Create the Legal Implicit Relation document that shows all of the possible
relations that could be generated if the ImplicitRelations defined
on the DomainSpecifcation were used, based on the solved outcome of the specified
InformationExtraction.
|
protected void |
createMarkingRelations(List<InformationExtractionOutcomeMarkingRelation> markingRelsList,
Map<String,String> markingRelPairsMap,
List<InformationExtractionOutcomeMarking> sources,
List<InformationExtractionOutcomeMarking> targets,
InformationExtractionEntityRelationType entRelTyp,
AttributeValueTable ruleTable)
Creates the marking relations for the specified source and target markings,
using the specified InformationExtractionEntityRelationType.
|
Map<String,InformationExtractionEntityRelationType> |
getEntityRelationTypeMap()
Gets the EntityRelationType map, keyed by the uppercased
EntityRelationType name.
|
Map<String,InformationExtractionEntityType> |
getEntityTypeMap()
Gets the EntityType map, keyed by the uppercased
EntityType name.
|
InformationExtraction |
getInformationExtraction()
Gets the InformationExtraction context.
|
InformationExtractionDomainSpecification |
getInformationExtractionDomainSpecification()
Gets the InformationExtractionDomainSpecification implied during
construction, that is used to get the defined ImplicitRelations.
|
List<InformationExtractionOutcomeMarking> |
getMarkingsList()
Gets the list of InformationExtractionOutcomeMarking that will be used to
generate the implicit relations.
|
ImplicitRelationUtilities.DependentPath |
getShortestDependentPath(InformationExtractionOutcomeMarking source,
InformationExtractionOutcomeMarking target)
Calculate the Shortest Dependent Path (SDP) length
between source & target.
|
public static final String KEY_IMPLICITREL_ALLOWSELFRELATIONS
public static final String KEY_IMPLICITREL_FIRSTSOURCEONLY
public static final String KEY_IMPLICITREL_MAXSENTENCEDISTANCE
public static final String KEY_IMPLICITREL_SHORTESTDEPENDENTPATHTHRESHOLD
public static final String CRLF
public static final String INDENT
public ImplicitRelationUtilities(InformationExtraction ext, List<InformationExtractionOutcomeMarking> markingsList) throws IfsException
Inputs include the InformationExtraction and the list of InformationExtractionOutcomeMarkings already determined.
ext
- the InformationExtraction being processedmarkingsList
- the list of markings already determined by the solverIfsException
- if the operation failspublic ImplicitRelationUtilities(InformationExtractionOutcome outcome) throws IfsException
The markings from the specified outcome will be used to generate the implicit relations.
outcome
- the InformationExtractionOutcome which contains the set
of markingsIfsException
- if the operation failspublic InformationExtraction getInformationExtraction()
public InformationExtractionDomainSpecification getInformationExtractionDomainSpecification()
public List<InformationExtractionOutcomeMarking> getMarkingsList()
public Map<String,InformationExtractionEntityType> getEntityTypeMap()
public Map<String,InformationExtractionEntityRelationType> getEntityRelationTypeMap()
public List<InformationExtractionOutcomeMarkingRelation> createImplicitRelations() throws IfsException
IfsException
- if the operation failsprotected void createMarkingRelations(List<InformationExtractionOutcomeMarkingRelation> markingRelsList, Map<String,String> markingRelPairsMap, List<InformationExtractionOutcomeMarking> sources, List<InformationExtractionOutcomeMarking> targets, InformationExtractionEntityRelationType entRelTyp, AttributeValueTable ruleTable) throws IfsException
markingRelsList
- the list of marking relations to add tomarkingRelPairsMap
- the map of all marking pairs that have
a connecting relationsources
- the source markingstargets
- the target markingsentRelTyp
- the InformationExtractionEntityRelationType to useruleTable
- the rule settingsIfsException
- if the operation failspublic ImplicitRelationUtilities.DependentPath getShortestDependentPath(InformationExtractionOutcomeMarking source, InformationExtractionOutcomeMarking target) throws IfsException
source
- the source markingtarget
- the target markingIfsException
- if the operation failspublic static void createLegalImplicitRelationsDocument(InformationExtraction ext) throws IfsException
This variant will not create a temp file containing the contents of the document.
ext
- the InformationExtraction whose solved outcome will be usedIfsException
- if the operation failspublic static void createLegalImplicitRelationsDocument(InformationExtraction ext, boolean writeToTemp) throws IfsException
ext
- the InformationExtraction whose solved outcome will be usedwriteToTemp
- whether to additionally write the content to a temp fileIfsException
- if the operation failspublic void createLegalImplicitRelationsDocument() throws IfsException
This variant will not create a temp file containing the contents of the document.
IfsException
- if the operation failspublic void createLegalImplicitRelationsDocument(boolean writeToTemp) throws IfsException
writeToTemp
- whether to additionally write the content to a temp fileIfsException
- if the operation failsCopyright © 2023. All rights reserved.