o
    i                     @   s   d dl mZmZmZmZ d dlmZmZ d dlm	Z	 ddl
mZ deee ee eeeef  f deee ee	 f fdd	Zd
eee ee	 f dedeee	 ef fddZdS )    )CallableListTupleUnion)Modelregistry)Ints2d   )Doccolumnsreturnc                 C   s   t dtd| idS )Nextract_featuresr   )attrs)r   forward)r    r   M/home/ubuntu/.local/lib/python3.10/site-packages/spacy/ml/featureextractor.pyFeatureExtractor	   s   r   modelis_trainc                 C   s   | j d }g }|D ]3}t|dr||}n|j||j|j }|jdkr1||jd df}|	| j
j|dd q	dd }||fS )	Nr   to_array   r   uint64)dtypec                 S   s   g S )Nr   )
d_featuresr   r   r   <lambda>   s    zforward.<locals>.<lambda>)r   hasattrr   docstartendndimreshapeshapeappendops	asarray2i)r   docsr   r   featuresr   r   backpropr   r   r   r      s   


r   N)typingr   r   r   r   	thinc.apir   r   thinc.typesr   tokensr
   strintr   boolr   r   r   r   r   <module>   s      
