src.dackar.pipelines.GeneralEntity ================================== .. py:module:: src.dackar.pipelines.GeneralEntity Attributes ---------- .. autoapisummary:: src.dackar.pipelines.GeneralEntity.logger Classes ------- .. autoapisummary:: src.dackar.pipelines.GeneralEntity.GeneralEntity Functions --------- .. autoapisummary:: src.dackar.pipelines.GeneralEntity.create_general_component Module Contents --------------- .. py:data:: logger .. py:function:: create_general_component(nlp, name, patterns, asSpan) .. py:class:: GeneralEntity(nlp, patterns, asSpan=True, callback=None) Bases: :py:obj:`object` How to use it: .. code-block:: python from GeneralEntity import GeneralEntity nlp = spacy.load("en_core_web_sm") patterns = {'label': 'general', 'pattern': [{'LOWER': 'possible'}], 'id': 'general'} cmatcher = generalEntity(nlp, patterns) doc = nlp("Vibration seems like it is coming from the shaft.") updatedDoc = cmatcher(doc) or: .. code-block:: python nlp.add_pipe('general_entity', config={"patterns": {'label': 'general', 'pattern': [{'LOWER': 'possible'}], 'id': 'general'}, "asSpan":True}) newDoc = nlp(doc.text) .. py:attribute:: name :value: 'general_entity' .. py:attribute:: entityRuler .. py:attribute:: asSpan :value: True .. py:method:: __call__(doc) :param doc: spacy.tokens.doc.Doc, the processed document using nlp pipelines