├── .idea ├── electra_pytorch.iml ├── inspectionProfiles │ └── profiles_settings.xml ├── misc.xml ├── modules.xml └── workspace.xml ├── LICENSE ├── README.md ├── __init__.py ├── callback ├── __init__.py ├── lr_scheduler.py ├── modelcheckpoint.py ├── optimization │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-37.pyc │ │ └── adamw.cpython-37.pyc │ ├── adabound.py │ ├── adafactor.py │ ├── adamw.py │ ├── lamb.py │ ├── lars.py │ ├── lookahead.py │ ├── nadam.py │ ├── novograd.py │ ├── planradam.py │ ├── radam.py │ ├── ralamb.py │ ├── ralars.py │ └── sgdw.py ├── progressbar.py └── trainingmonitor.py ├── convert_electra_tf_checkpoint_to_pytorch.py ├── dataset └── .gitignore ├── metrics ├── __init__.py ├── custom_metrics.py └── task_compute_metrics.py ├── model ├── __init__.py ├── activations.py ├── configuration_electra.py ├── configuration_utils.py ├── file_utils.py ├── modeling_electra.py ├── modeling_utils.py ├── tokenization_bert.py └── tokenization_utils.py ├── outputs ├── .gitignore └── training.png ├── prepare_lm_data_ngram.py ├── prev_trained_model ├── .gitignore ├── electra_base │ ├── config.json │ └── vocab.txt ├── electra_base_zh │ ├── config.json │ └── vocab.txt ├── electra_large │ ├── config.json │ └── vocab.txt ├── electra_small │ ├── config.json │ └── vocab.txt ├── electra_small_zh │ ├── config.json │ └── vocab.txt └── electra_tiny │ ├── config.json │ └── vocab.txt ├── processors ├── __init__.py ├── task_processor.py └── utils.py ├── run_classifier.py ├── run_pretraining.py ├── scripts ├── run_classifier_afqmc.sh ├── run_classifier_chnsenticrop.sh ├── run_classifier_cmnli.sh ├── run_classifier_cola.sh ├── run_classifier_csl.sh ├── run_classifier_iflytek.sh ├── run_classifier_lcqmc.sh ├── run_classifier_mnli.sh ├── run_classifier_qqp.sh ├── run_classifier_sst2.sh ├── run_classifier_stsb.sh └── run_classifier_tnews.sh └── tools ├── common.py ├── download_clue_data.py └── download_glue_data.py /.idea/electra_pytorch.iml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/.idea/electra_pytorch.iml -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/.idea/inspectionProfiles/profiles_settings.xml -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/.idea/misc.xml -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/.idea/modules.xml -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/.idea/workspace.xml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/README.md -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | #encoding:utf-8 -------------------------------------------------------------------------------- /callback/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /callback/lr_scheduler.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/lr_scheduler.py -------------------------------------------------------------------------------- /callback/modelcheckpoint.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/modelcheckpoint.py -------------------------------------------------------------------------------- /callback/optimization/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /callback/optimization/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /callback/optimization/__pycache__/adamw.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/__pycache__/adamw.cpython-37.pyc -------------------------------------------------------------------------------- /callback/optimization/adabound.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/adabound.py -------------------------------------------------------------------------------- /callback/optimization/adafactor.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/adafactor.py -------------------------------------------------------------------------------- /callback/optimization/adamw.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/adamw.py -------------------------------------------------------------------------------- /callback/optimization/lamb.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/lamb.py -------------------------------------------------------------------------------- /callback/optimization/lars.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/lars.py -------------------------------------------------------------------------------- /callback/optimization/lookahead.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/lookahead.py -------------------------------------------------------------------------------- /callback/optimization/nadam.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/nadam.py -------------------------------------------------------------------------------- /callback/optimization/novograd.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/novograd.py -------------------------------------------------------------------------------- /callback/optimization/planradam.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/planradam.py -------------------------------------------------------------------------------- /callback/optimization/radam.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/radam.py -------------------------------------------------------------------------------- /callback/optimization/ralamb.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/ralamb.py -------------------------------------------------------------------------------- /callback/optimization/ralars.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/ralars.py -------------------------------------------------------------------------------- /callback/optimization/sgdw.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/optimization/sgdw.py -------------------------------------------------------------------------------- /callback/progressbar.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/progressbar.py -------------------------------------------------------------------------------- /callback/trainingmonitor.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/callback/trainingmonitor.py -------------------------------------------------------------------------------- /convert_electra_tf_checkpoint_to_pytorch.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/convert_electra_tf_checkpoint_to_pytorch.py -------------------------------------------------------------------------------- /dataset/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/dataset/.gitignore -------------------------------------------------------------------------------- /metrics/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /metrics/custom_metrics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/metrics/custom_metrics.py -------------------------------------------------------------------------------- /metrics/task_compute_metrics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/metrics/task_compute_metrics.py -------------------------------------------------------------------------------- /model/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /model/activations.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/model/activations.py -------------------------------------------------------------------------------- /model/configuration_electra.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/model/configuration_electra.py -------------------------------------------------------------------------------- /model/configuration_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/model/configuration_utils.py -------------------------------------------------------------------------------- /model/file_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/model/file_utils.py -------------------------------------------------------------------------------- /model/modeling_electra.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/model/modeling_electra.py -------------------------------------------------------------------------------- /model/modeling_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/model/modeling_utils.py -------------------------------------------------------------------------------- /model/tokenization_bert.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/model/tokenization_bert.py -------------------------------------------------------------------------------- /model/tokenization_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/model/tokenization_utils.py -------------------------------------------------------------------------------- /outputs/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/outputs/.gitignore -------------------------------------------------------------------------------- /outputs/training.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/outputs/training.png -------------------------------------------------------------------------------- /prepare_lm_data_ngram.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prepare_lm_data_ngram.py -------------------------------------------------------------------------------- /prev_trained_model/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/.gitignore -------------------------------------------------------------------------------- /prev_trained_model/electra_base/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_base/config.json -------------------------------------------------------------------------------- /prev_trained_model/electra_base/vocab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_base/vocab.txt -------------------------------------------------------------------------------- /prev_trained_model/electra_base_zh/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_base_zh/config.json -------------------------------------------------------------------------------- /prev_trained_model/electra_base_zh/vocab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_base_zh/vocab.txt -------------------------------------------------------------------------------- /prev_trained_model/electra_large/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_large/config.json -------------------------------------------------------------------------------- /prev_trained_model/electra_large/vocab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_large/vocab.txt -------------------------------------------------------------------------------- /prev_trained_model/electra_small/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_small/config.json -------------------------------------------------------------------------------- /prev_trained_model/electra_small/vocab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_small/vocab.txt -------------------------------------------------------------------------------- /prev_trained_model/electra_small_zh/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_small_zh/config.json -------------------------------------------------------------------------------- /prev_trained_model/electra_small_zh/vocab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_small_zh/vocab.txt -------------------------------------------------------------------------------- /prev_trained_model/electra_tiny/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_tiny/config.json -------------------------------------------------------------------------------- /prev_trained_model/electra_tiny/vocab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/prev_trained_model/electra_tiny/vocab.txt -------------------------------------------------------------------------------- /processors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/processors/__init__.py -------------------------------------------------------------------------------- /processors/task_processor.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/processors/task_processor.py -------------------------------------------------------------------------------- /processors/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/processors/utils.py -------------------------------------------------------------------------------- /run_classifier.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/run_classifier.py -------------------------------------------------------------------------------- /run_pretraining.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/run_pretraining.py -------------------------------------------------------------------------------- /scripts/run_classifier_afqmc.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_afqmc.sh -------------------------------------------------------------------------------- /scripts/run_classifier_chnsenticrop.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_chnsenticrop.sh -------------------------------------------------------------------------------- /scripts/run_classifier_cmnli.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_cmnli.sh -------------------------------------------------------------------------------- /scripts/run_classifier_cola.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_cola.sh -------------------------------------------------------------------------------- /scripts/run_classifier_csl.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_csl.sh -------------------------------------------------------------------------------- /scripts/run_classifier_iflytek.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_iflytek.sh -------------------------------------------------------------------------------- /scripts/run_classifier_lcqmc.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_lcqmc.sh -------------------------------------------------------------------------------- /scripts/run_classifier_mnli.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_mnli.sh -------------------------------------------------------------------------------- /scripts/run_classifier_qqp.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_qqp.sh -------------------------------------------------------------------------------- /scripts/run_classifier_sst2.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_sst2.sh -------------------------------------------------------------------------------- /scripts/run_classifier_stsb.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_stsb.sh -------------------------------------------------------------------------------- /scripts/run_classifier_tnews.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/scripts/run_classifier_tnews.sh -------------------------------------------------------------------------------- /tools/common.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/tools/common.py -------------------------------------------------------------------------------- /tools/download_clue_data.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/tools/download_clue_data.py -------------------------------------------------------------------------------- /tools/download_glue_data.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lonePatient/electra_pytorch/HEAD/tools/download_glue_data.py --------------------------------------------------------------------------------