src.dackar.causal.CausalSimple ============================== .. py:module:: src.dackar.causal.CausalSimple .. autoapi-nested-parse:: Created on April, 2024 @author: wangc, mandd Attributes ---------- .. autoapisummary:: src.dackar.causal.CausalSimple.logger Classes ------- .. autoapisummary:: src.dackar.causal.CausalSimple.CausalSimple Module Contents --------------- .. py:data:: logger .. py:class:: CausalSimple(nlp, entID='SSC', causalKeywordID='causal', *args, **kwargs) Bases: :py:obj:`src.dackar.causal.CausalBase.CausalBase` Class to process OPG Operator Shift Logs dataset .. py:attribute:: _subjList :value: ['nsubj', 'nsubjpass', 'nsubj:pass'] .. py:attribute:: _objList :value: ['pobj', 'dobj', 'iobj', 'obj', 'obl', 'oprd'] .. py:attribute:: _entInfoNames :value: ['entity', 'label', '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:: 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