
    9i              
          S SK JrJr  S SKJr  S SKJrJr  S SKJ	r
  S SKJr  \
R                  " 5       r	\R                  " \R                  \R                   S9\R                  " \R"                  \R                   S9\R                  " \R$                  \R                   S9\R                  " \R&                  \R                   S9\R                  " \R&                  \R(                  S9 " S S\5      5       5       5       5       5       rg	)
    )HeadsModels)MODELS)ModelForTokenClassification"ModelForTokenClassificationWithCRF)logger)Tasks)module_namec                   `   ^  \ rS rSrSrSr\R                  r\	R                  rU 4S jrSrU =r$ )!LSTMForTokenClassificationWithCRF   zModel 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                    > [         [        U ]  5       n[        US5      (       a  UR                  OUR
                  US'   U R                  R                  US'   U$ )Nhidden_size
num_labels)superr   parse_head_cfghasattrr   lstm_hidden_sizeconfigr   )selfhead_cfg	__class__s     o/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/modelscope/models/nlp/lstm/token_classification.pyr   0LSTMForTokenClassificationWithCRF.parse_head_cfg+   s[    4dJL x//   5=5N5N 	 "&!7!7     )__name__
__module____qualname____firstlineno____doc__override_base_model_typer   lstmbase_model_typer   lstm_crf	head_typer   __static_attributes____classcell__)r   s   @r   r   r      s,      $kkOI r   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   <module>r7      s   $ . ,E . +				 22L	""=,,&++F//V[[I//V=M=MN(J  O J G= Mr   