src.dackar.workflows.OperatorShiftLogsProcessing

Created on April, 2024

@author: wangc, mandd

Attributes

logger

Classes

OperatorShiftLogs

Class to process OPG Operator Shift Logs dataset

Module Contents

src.dackar.workflows.OperatorShiftLogsProcessing.logger[source]
class src.dackar.workflows.OperatorShiftLogsProcessing.OperatorShiftLogs(nlp, entID='SSC', causalKeywordID='causal', *args, **kwargs)[source]

Bases: src.dackar.workflows.WorkflowBase.WorkflowBase

Class to process OPG Operator Shift Logs dataset

_allRelPairs = [][source]
_relationNames = ['Subj_Entity', 'Relation', 'Obj_Entity'][source]
_subjList = ['nsubj', 'nsubjpass', 'nsubj:pass'][source]
_objList = ['pobj', 'dobj', 'iobj', 'obj', 'obl', 'oprd'][source]
_extractedInfoNames = ['Entity', 'Status', 'Amod', 'Action', 'Dep', 'Alias', 'Negation', 'Conjecture', 'Sentence'][source]
reset()[source]

Reset rule-based matcher

textProcess()[source]

Function to clean text

Parameters:

None

Returns:

procObj, DACKAR.Preprocessing object

extractInformation()[source]

extract information

Parameters:

None

Returns:

None

extractStatus(matchedSents, predSynonyms=[], exclPrepos=[])[source]

Extract health status and relation

Parameters:
  • matchedSents – list, the matched sentences

  • predSynonyms – list, predicate synonyms

  • exclPrepos – list, exclude the prepositions

handleValidSent(sent, ents)[source]

Handle sentence that do not have (subj, predicate, obj)

handleInvalidSent(sent, ents)[source]

Handle sentence that do not have (subj, predicate, obj)

extractRelDep(matchedSents)[source]
Parameters:

matchedSents – list, the list of matched sentences

Returns:

generator, the extracted causal relation

Return type:

(subject tuple, predicate, object tuple)

extractCausalRelDep(matchedSents)[source]
Parameters:

matchedSents – list, the list of matched sentences

Returns:

generator, the extracted causal relation

Return type:

(subject tuple, predicate, object tuple)

isSubElements(elem1, elemList)[source]
isSubElement(elem1, elem2)[source]

True if elem1 is a subelement of elem2