B
    .(b                 @   s   d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
 dd Zejjd	d
 Zejddddgdddgdddggdd Zejdddddddddddddddddddddgdd ZdS )    )unicode_literalsN)Tok2Vec)Vocab)Doc)unicode_c             C   s\   t  }g }d}xHtd| d D ]6}dd t||| D }|t||d ||7 }qW |S )Nr      c             S   s   g | ]}t |qS  )r   ).0ir   r   G/home/dcms/DCMS/lib/python3.7/site-packages/spacy/tests/test_tok2vec.py
<listcomp>   s    zget_batch.<locals>.<listcomp>)words)r   rangeappendr   )
batch_sizevocabdocsstartsizeZnumbersr   r   r   	get_batch   s    r   c              C   s^   d} d}t  }t|g d}t| |}||g\}}t|dksDt|d jd| fksZtd S )N   i  )r   r   r   )r   r   r   begin_updatelenAssertionErrorshape)width
embed_sizer   doctok2vecvectorsbackpropr   r   r   test_empty_doc   s    
r!   zbatch_size,width,embed_sizer   r   i           ?   c       	      C   sf   t | }t||}||\}}t|t|ks4tx,t||D ]\}}|jt||fks@tq@W d S )N)r   r   r   r   r   zipr   )	r   r   r   batchr   r   r    Zdoc_vecr   r   r   r   test_tok2vec_batch_sizes&   s    
r(   tok2vec_configd   F)r   r   Z
char_embedT   )r   r   Z
conv_depth)r   r   Zsubword_featuresc             C   sb   t d}tf | }||\}}t|t|ks4t|d jt|d | d fksVt|| d S )Nr#   r   r   )r   r   r   r   r   r   )r)   r   r   r   r    r   r   r   test_tok2vec_configs2   s    
"r,   )
__future__r   ZpytestZ	spacy._mlr   Zspacy.vocabr   Zspacy.tokensr   Zspacy.compatr   r   markZxfailr!   Zparametrizer(   r,   r   r   r   r   <module>   s    (



