o
    ߥi                  	   @   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   lstm_hidden_sizeconfigr   )selfhead_cfg	__class__ c/home/ubuntu/.local/lib/python3.10/site-packages/modelscope/models/nlp/lstm/token_classification.pyr   +   s   z0LSTMForTokenClassificationWithCRF.parse_head_cfg)__name__
__module____qualname____doc__override_base_model_typer   lstmbase_model_typer   lstm_crf	head_typer   __classcell__r   r   r   r   r
      s    r
   N)modelscope.metainfor   r   modelscope.models.builderr   !modelscope.models.nlp.task_modelsr   r   modelscope.utilsr   loggingmodelscope.utils.constantr   
get_loggerregister_moduletoken_classificationlcrfnamed_entity_recognitionpart_of_speechword_segmentation	lcrf_wsegr
   r   r   r   r   <module>   s   