kazu.krt.string_editor.utils¶
Classes
This class represents a conflict in resources. |
|
This class is responsible for managing |
- class kazu.krt.string_editor.utils.CaseConflictResolutionRequest[source]¶
Bases:
Enum- CUSTOM = 3¶
- OPTIMISTIC = 2¶
- PESSIMISTIC = 1¶
- class kazu.krt.string_editor.utils.ResourceConflict[source]¶
Bases:
objectThis class represents a conflict in resources.
It provides methods to resolve these conflicts optimistically or pessimistically.
- __init__(conflict_dict)[source]¶
- Parameters:
conflict_dict (dict[str, Iterable[OntologyStringResource]]) – A dictionary mapping parser names to a list of resources that are in conflict.
- batch_resolve(optimistic)[source]¶
Resolve the conflict in batch, changing the parameters of all synonyms at once to share the same values.
The optimistic param indicates the minimum case sensitivity and maximum mention confidence should be chosen (otherwise vice-versa)
- Parameters:
optimistic (bool) – Whether to resolve the conflict optimistically or pessimistically.
- Return type:
None
- class kazu.krt.string_editor.utils.ResourceConflictManager[source]¶
Bases:
objectThis class is responsible for managing
ResourceConflicts in resources.It provides methods to find conflicts in resources, sync resources for resolved string conflicts and find new conflicts.
- __init__(manager)[source]¶
Initialize with a
ResourceManager.- Parameters:
manager (ResourceManager) – The
ResourceManagerto use.
- summary_df()[source]¶
Create a summary
DataFrameof unresolved conflicts.- Returns:
A DataFrame summarizing the unresolved conflicts.
- Return type:
- sync_resources_for_resolved_resource_conflict_and_find_new_conflicts(conflict)[source]¶
Sync resources for a resolved conflict and find new conflicts.
This will refresh the internal map of conflicts.
- Parameters:
conflict (ResourceConflict) – a resolved
ResourceConflict.- Return type:
None