o
    *j                  	   @   s   d dl mZmZ d dlmZ d dlmZmZ d dlm	Z
 d dlmZ e
 Z	ejejejdejejejdejejejdejejejdejejejdG dd deZd	S )
    )HeadsModels)MODELS)ModelForTokenClassification"ModelForTokenClassificationWithCRF)logger)Tasks)module_namec                       s0   e Zd ZdZdZejZej	Z
 fddZ  ZS )!LSTMForTokenClassificationWithCRFzModel with a token classification head on top (a linear layer on top of
    the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks, word-segmentation.

    Tc                    s8   t t|  }t|dr|jn|j|d< | jj|d< |S )Nhidden_size
num_labels)superr   parse_head_cfghasattrr   Zlstm_hidden_sizeconfigr   )selfZhead_cfg	__class__ p/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/modelscope/models/nlp/lstm/token_classification.pyr   +   s   z0LSTMForTokenClassificationWithCRF.parse_head_cfg)__name__
__module____qualname____doc__Zoverride_base_model_typer   ZlstmZbase_model_typer   Zlstm_crfZ	head_typer   __classcell__r   r   r   r   r
      s    r
   N)Zmodelscope.metainfor   r   Zmodelscope.models.builderr   Z!modelscope.models.nlp.task_modelsr   r   Zmodelscope.utilsr   loggingZmodelscope.utils.constantr   Z
get_loggerZregister_moduleZtoken_classificationZlcrfZnamed_entity_recognitionZpart_of_speechZword_segmentationZ	lcrf_wsegr
   r   r   r   r   <module>   s   