
    h                        S SK JrJrJr  S SKJrJrJrJrJ	r	J
r
JrJrJrJrJrJrJr  S SKJrJr  SSKJr  SSKJr  SSKJr  SS
\\\4   4S jjrS\S
\\\4   4S jrS\\\   \\   4   S\\\4   S\\\4   S
\\\\   \4   \4   4S jrg	)    )ListTuplecast)LinearLogisticMaxoutModelchainconcatenateglorot_uniform_initlist2raggedreduce_firstreduce_last
reduce_maxreduce_meanwith_getitem)Floats2dRagged   )Doc)registry   )extract_spansNreturnc                 B    [        [        X[        S9[        5       5      $ )zjAn output layer for multi-label classification. It uses a linear layer
followed by a logistic activation.
)nOnIinit_W)r
   r   r   r   )r   r   s     Q/home/james-whalen/.local/lib/python3.13/site-packages/spacy/ml/models/spancat.pybuild_linear_logisticr       s     2-@A8:NN    hidden_sizec           
          [        [        [        [        [        [
        4   [        5       5      [        [        [        [
        4   [        5       5      [        5       [        5       5      [        U SSS95      $ )zReduce sequences by concatenating their mean and max pooled vectors,
and then combine the concatenated vectors with a hidden layer.
Tg        )r   	normalizedropout)r
   r   r   r	   r   r   r   r   r   r   r   )r"   s    r   build_mean_max_reducerr&       s]     vx'(+-8vx'(,.9ML		
 	+s; r!   tok2vecreducerscorerc                    [        [        [        [        [        [
           [        4   [        [        [        4   4   [        S[        U [        [        [        [           [        4   [        5       5      5      5      5      [        5       UU5      nUR                  SU 5        UR                  SU5        UR                  SU5        U$ )ay  Build a span categorizer model, given a token-to-vector model, a
reducer model to map the sequence of vectors for each span down to a single
vector, and a scorer model to map the vectors to probabilities.

tok2vec (Model[List[Doc], List[Floats2d]]): The tok2vec model.
reducer (Model[Ragged, Floats2d]): The reducer model.
scorer (Model[Floats2d, Floats2d]): The scorer model.
r   r'   r(   r)   )r
   r   r	   r   r   r   r   r   r   r   r   set_ref)r'   r(   r)   models       r   build_spancat_modelr-   /   s     %S	6)*E&&.,AAB5$uT(^V-C'Dkm"TU	
 	
E 
MM)W%	MM)W%	MM(F#Lr!   )NN)typingr   r   r   	thinc.apir   r   r   r	   r
   r   r   r   r   r   r   r   r   thinc.typesr   r   tokensr   utilr   r   r    intr&   r-    r!   r   <module>r5      s    $ $    )   )OuXx5G/H O fh6F0G 49d8n,-68#$ (H$% 5cF"#X-.	r!   