src.dackar.workflows.OperatorShiftLogsProcessing ================================================ .. py:module:: src.dackar.workflows.OperatorShiftLogsProcessing .. autoapi-nested-parse:: Created on April, 2024 @author: wangc, mandd Attributes ---------- .. autoapisummary:: src.dackar.workflows.OperatorShiftLogsProcessing.logger Classes ------- .. autoapisummary:: src.dackar.workflows.OperatorShiftLogsProcessing.OperatorShiftLogs Module Contents --------------- .. py:data:: logger .. py:class:: OperatorShiftLogs(nlp, entID='SSC', causalKeywordID='causal', *args, **kwargs) Bases: :py:obj:`src.dackar.workflows.WorkflowBase.WorkflowBase` Class to process OPG Operator Shift Logs dataset .. py:attribute:: _allRelPairs :value: [] .. py:attribute:: _relationNames :value: ['Subj_Entity', 'Relation', 'Obj_Entity'] .. py:attribute:: _subjList :value: ['nsubj', 'nsubjpass', 'nsubj:pass'] .. py:attribute:: _objList :value: ['pobj', 'dobj', 'iobj', 'obj', 'obl', 'oprd'] .. py:attribute:: _extractedInfoNames :value: ['Entity', 'Status', 'Amod', 'Action', 'Dep', 'Alias', 'Negation', 'Conjecture', 'Sentence'] .. py:method:: reset() Reset rule-based matcher .. py:method:: textProcess() Function to clean text :param None: :returns: procObj, DACKAR.Preprocessing object .. py:method:: extractInformation() extract information :param None: :returns: None .. py:method:: extractStatus(matchedSents, predSynonyms=[], exclPrepos=[]) Extract health status and relation :param matchedSents: list, the matched sentences :param predSynonyms: list, predicate synonyms :param exclPrepos: list, exclude the prepositions .. py:method:: handleValidSent(sent, ents) Handle sentence that do not have (subj, predicate, obj) .. py:method:: handleInvalidSent(sent, ents) Handle sentence that do not have (subj, predicate, obj) .. py:method:: extractRelDep(matchedSents) :param matchedSents: list, the list of matched sentences :returns: generator, the extracted causal relation :rtype: (subject tuple, predicate, object tuple) .. py:method:: extractCausalRelDep(matchedSents) :param matchedSents: list, the list of matched sentences :returns: generator, the extracted causal relation :rtype: (subject tuple, predicate, object tuple) .. py:method:: isSubElements(elem1, elemList) .. py:method:: isSubElement(elem1, elem2) True if elem1 is a subelement of elem2