/usr/local/lib/python3.6/site-packages/transformers/data/datasets/__pycache__
NameSizeModeActions
glue.cpython-36.pyc47010644editdlrm
language_modeling.cpython-36.pyc137320644editdlrm
squad.cpython-36.pyc60580644editdlrm
__init__.cpython-36.pyc5210644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/transformers/data/datasets/__pycache__/glue.cpython-36.pyc (4701B)
3 Eg@sddlZddlZddlZddlmZmZddlmZddlm Z m Z m Z ddl Z ddl mZddlmZddlmZdd lmZd d lmZmZmZd d lmZejeZeGd ddZGdddeZGdddeZ dS)N) dataclassfield)Enum)ListOptionalUnion)Dataset)FileLock)PreTrainedTokenizerBase)logging)!glue_convert_examples_to_featuresglue_output_modesglue_processors) InputFeaturesc@steZdZUdZedddjejidZe eddidZ e  edddid Z e  ed dd id Z e d d ZdS)GlueDataTrainingArgumentsz Arguments pertaining to what data we are going to input our model for training and eval. Using `HfArgumentParser` we can turn this class into argparse arguments to be able to specify them on the command line. helpz"The name of the task to train on: z, )metadatazUThe input data dir. Should contain the .tsv files (or other data files) for the task.zThe maximum total input sequence length after tokenization. Sequences longer than this will be truncated, sequences shorter will be padded.)defaultrFz1Overwrite the cached training and evaluation setscCs|jj|_dS)N) task_namelower)selfrI/usr/local/lib/python3.6/site-packages/transformers/data/datasets/glue.py __post_init__<sz'GlueDataTrainingArguments.__post_init__N)__name__ __module__ __qualname____doc__rjoinrkeysrstrdata_dirmax_seq_lengthintoverwrite_cacheboolrrrrrr$s  rc@seZdZdZdZdZdS)SplittraindevtestN)rrrr*r+r,rrrrr)@sr)c@speZdZUdZeeee  de j dfee eeeee feedddZddZe dd d Zd d ZdS) GlueDatasetzH This will be superseded by a framework-agnostic approach soon. N)args tokenizer limit_lengthmode cache_dirc Cstjdt||_t|j|_t|j|_t |t r`y t |}Wnt k r^t dYnXt jj|dk rr|n|jd|jd|jjd|jd|j}|jj}|jdkr|jjdkr|d |d |d <|d <||_|d}t|t jj|r<|j r isinstancer#r)KeyErrorospathr!r$value __class__rr% get_labelsr=r existsr'timetorchloadfeaturesloggerinfor+Zget_dev_examplesr,Zget_test_examplesZget_train_examplesrsave) rr.r/r0r1r2Zcached_features_filer=Z lock_pathstartZexamplesrrr__init__Os`   (        zGlueDataset.__init__cCs t|jS)N)lenrN)rrrr__len__szGlueDataset.__len__)returncCs |j|S)N)rN)rirrr __getitem__szGlueDataset.__getitem__cCs|jS)N)r=)rrrrrIszGlueDataset.get_labels)rrrr rr.r#r>rrrNr)r*r rr&rrSrUrXrIrrrrr-Fs *Er-)!rErKr?Z dataclassesrrenumrtypingrrrrLZtorch.utils.datarZfilelockr Ztokenization_utils_baser utilsr Zprocessors.gluerrrZprocessors.utilsr get_loggerrrOrr)r-rrrrs