{"id":31939663,"url":"https://github.com/alibaba/easytransfer","last_synced_at":"2025-10-14T08:44:46.098Z","repository":{"id":37665615,"uuid":"292165029","full_name":"alibaba/EasyTransfer","owner":"alibaba","description":"EasyTransfer is designed to make the development of transfer learning in NLP applications easier.","archived":false,"fork":false,"pushed_at":"2022-08-25T06:48:53.000Z","size":3790,"stargazers_count":860,"open_issues_count":23,"forks_count":159,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-09-25T09:45:41.268Z","etag":null,"topics":["bert","knowledge-distillation","nlp-applications","transfer-learning"],"latest_commit_sha":null,"homepage":"https://www.yuque.com/easytransfer/cn/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alibaba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-02T03:04:42.000Z","updated_at":"2025-09-11T17:49:02.000Z","dependencies_parsed_at":"2022-07-14T21:46:51.767Z","dependency_job_id":null,"html_url":"https://github.com/alibaba/EasyTransfer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/alibaba/EasyTransfer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FEasyTransfer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FEasyTransfer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FEasyTransfer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FEasyTransfer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alibaba","download_url":"https://codeload.github.com/alibaba/EasyTransfer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alibaba%2FEasyTransfer/sbom","scorecard":{"id":183618,"data":{"date":"2025-08-11","repo":{"name":"github.com/alibaba/EasyTransfer","commit":"d6912e2da3061935bf82bd429bc7a16a7a06e3a3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 2/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T19:21:25.843Z","repository_id":37665615,"created_at":"2025-08-16T19:21:25.844Z","updated_at":"2025-08-16T19:21:25.844Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018302,"owners_count":26086345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bert","knowledge-distillation","nlp-applications","transfer-learning"],"created_at":"2025-10-14T08:44:39.835Z","updated_at":"2025-10-14T08:44:46.091Z","avatar_url":"https://github.com/alibaba.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EasyTransfer:  A Simple and Scalable Deep Transfer Learning Platform for NLP Applications\n\n# Intro\nThe literature has witnessed the success of applying deep Transfer Learning (TL) for many real-world NLP applications, yet it is not easy to build an easy-to-use TL toolkit to achieve such a goal. To bridge this gap, EasyTransfer is designed to facilitate users leveraging deep TL for NLP applications at ease. It was developed in Alibaba in early 2017, and has been used in the major BUs in Alibaba group and achieved very good results in 20+ business scenarios. It supports the mainstream pre-trained ModelZoo, including pre-trained language models (PLMs) and multi-modal models on the [PAI](https://www.aliyun.com/product/bigdata/product/learn) platform, integrates the SOTA models for the mainstream NLP applications in AppZoo, and supports knowledge distillation for PLMs. EasyTransfer is very convenient for users to quickly start model training, evaluation, offline prediction, and online deployment. It also provides rich APIs to make the development of NLP and transfer learning easier.\n\n\n# Main Features\n\n- **Language model pre-training tool:** it supports a comprehensive pre-training tool for users to pre-train language models such as T5 and BERT. Based on the tool, the user can easily train a model to achieve great results in the benchmark leaderboards such as CLUE, GLUE, and SuperGLUE;\n- **ModelZoo with rich and high-quality pre-trained models:** supports the Continual Pre-training and Fine-tuning of mainstream LM models such as BERT, ALBERT, RoBERTa, T5, etc. It also supports a multi-modal model FashionBERT developed using the fashion domain data in Alibaba;\n- **AppZoo with rich and easy-to-use applications:** supports mainstream NLP applications and those models developed inside of Alibaba, e.g.: HCNN for text matching, and BERT-HAE for MRC.\n- **Automatic knowledge distillation:** supports task-adaptive knowledge distillation to distill knowledge from a teacher model to a small task-specific student model to reduce parameter size while keep comparable performance.\n- **Easy-to-use and high-performance distributed strategy:** based on the in-house [PAI](https://www.aliyun.com/product/bigdata/product/learn) features, it provides easy-to-use and high-performance distributed strategy for multiple CPU/GPU training.\n\n# Architecture\n![image.png](https://cdn.nlark.com/yuque/0/2020/png/2480469/1600310258839-04837b68-ef37-449d-8ff4-02dbd8dcef9e.png#align=left\u0026display=inline\u0026height=357\u0026margin=%5Bobject%20Object%5D\u0026name=image.png\u0026originHeight=713\u0026originWidth=1492\u0026size=182794\u0026status=done\u0026style=none\u0026width=746)\n\n# Installation\n\nYou can either install from pip \n\n```bash\n$ pip install easytransfer\n```\n\nor setup from the source：\n\n```bash\n$ git clone https://github.com/alibaba/EasyTransfer.git\n$ cd EasyTransfer\n$ python setup.py install\n```\nThis repo is tested on Python3.6/2.7, tensorflow 1.12.3\n\n\n# Quick Start\nNow let's show how to use just 30 lines of code to build a text classification model based on BERT. \n\n```python\nfrom easytransfer import base_model, layers, model_zoo, preprocessors\nfrom easytransfer.datasets import CSVReader, CSVWriter\nfrom easytransfer.losses import softmax_cross_entropy\nfrom easytransfer.evaluators import classification_eval_metrics\n\nclass TextClassification(base_model):\n    def __init__(self, **kwargs):\n        super(TextClassification, self).__init__(**kwargs)\n\tself.pretrained_model_name = \"google-bert-base-en\"\n        self.num_labels = 2\n        \n    def build_logits(self, features, mode=None):\n        preprocessor = preprocessors.get_preprocessor(self.pretrained_model_name)\n        model = model_zoo.get_pretrained_model(self.pretrained_model_name)\n        dense = layers.Dense(self.num_labels)\n        input_ids, input_mask, segment_ids, label_ids = preprocessor(features)\n        _, pooled_output = model([input_ids, input_mask, segment_ids], mode=mode)\n        return dense(pooled_output), label_ids\n\n    def build_loss(self, logits, labels):\n        return softmax_cross_entropy(labels, self.num_labels, logits)\n    \n    def build_eval_metrics(self, logits, labels):\n        return classification_eval_metrics(logits, labels, self.num_labels)\n        \napp = TextClassification()\ntrain_reader = CSVReader(input_glob=app.train_input_fp, is_training=True, batch_size=app.train_batch_size)\neval_reader = CSVReader(input_glob=app.eval_input_fp, is_training=False, batch_size=app.eval_batch_size)              \napp.run_train_and_evaluate(train_reader=train_reader, eval_reader=eval_reader)\n```\nYou can find more details or play with the code in our Jupyter/Notebook [PAI-DSW](https://dsw-dev.data.aliyun.com/#/?fileUrl=https://raw.githubusercontent.com/alibaba/EasyTransfer/master/examples/easytransfer-quick_start.ipynb\u0026fileName=easytransfer-quick_start.ipynb). \n\nYou can also use AppZoo Command Line Tools to quickly train an App model. Take text classification on SST-2 dataset as an example. First you can download the [train.tsv](http://atp-modelzoo-sh.oss-cn-shanghai.aliyuncs.com/tutorial/glue/SST-2/train.tsv), [dev.tsv](http://atp-modelzoo-sh.oss-cn-shanghai.aliyuncs.com/tutorial/glue/SST-2/dev.tsv) and [test.tsv](http://atp-modelzoo-sh.oss-cn-shanghai.aliyuncs.com/tutorial/glue/SST-2/test.tsv), then start training: \n\n```bash\n$ easy_transfer_app --mode train \\\n    --inputTable=./train.tsv,./dev.tsv \\\n    --inputSchema=content:str:1,label:str:1 \\\n    --firstSequence=content \\\n    --sequenceLength=128 \\\n    --labelName=label \\\n    --labelEnumerateValues=0,1 \\\n    --checkpointDir=./sst2_models/\\\n    --numEpochs=3 \\\n    --batchSize=32 \\\n    --optimizerType=adam \\\n    --learningRate=2e-5 \\\n    --modelName=text_classify_bert \\\n    --advancedParameters='pretrain_model_name_or_path=google-bert-base-en'\n```\n\nAnd then predict:\n\n```bash\n$ easy_transfer_app --mode predict \\\n    --inputTable=./test.tsv \\\n    --outputTable=./test.pred.tsv \\\n    --inputSchema=id:str:1,content:str:1 \\\n    --firstSequence=content \\\n    --appendCols=content \\\n    --outputSchema=predictions,probabilities,logits \\\n    --checkpointPath=./sst2_models/ \n```\nTo learn more about the usage of AppZoo, please refer to our [documentation](https://www.yuque.com/easytransfer/itfpm9/ky6hky).\n\n\n\n# Tutorials\n\n- [PAI-ModelZoo (20+ pretrained models)](https://www.yuque.com/easytransfer/itfpm9/geiy58)\n- [FashionBERT-cross-modality pretrained model](https://www.yuque.com/easytransfer/itfpm9/nm3mxu)\n- [Knowledge Distillation including vanilla KD, Probes KD, AdaBERT](https://www.yuque.com/easytransfer/itfpm9/kp1dtx)\n- [BERT Feature Extraction](https://www.yuque.com/easytransfer/itfpm9/blz7k6)\n- [Text Matching including BERT, BERT Two Tower, DAM, HCNN](https://www.yuque.com/easytransfer/itfpm9/xfe19v)\n- [Text Classification including BERT, TextCNN](https://www.yuque.com/easytransfer/itfpm9/rypc5x)\n- [Machine Reading Comprehesion including BERT, BERT-HAE](https://www.yuque.com/easytransfer/itfpm9/qrvqco)\n- [Sequence Labeling including BERT](https://www.yuque.com/easytransfer/itfpm9/we0go2)\n- [Meta Fine-tuning for Cross-domain Text Classification](https://www.yuque.com/easytransfer/cn/mgy5gb)\n\n\n# [EasyNLP for CLUE Benchmark](https://github.com/alibaba/EasyNLP/tree/master/benchmarks/clue)\n\n\nHere is the [CLUE benchmark example](https://github.com/alibaba/EasyNLP/tree/master/benchmarks/clue)\n\nYou can find more benchmarks in [https://www.yuque.com/easytransfer/cn/rkm4p7](https://www.yuque.com/easytransfer/itfpm9/rkm4p7)\n\n\n# Links\n\nTutorials：[https://www.yuque.com/easytransfer/itfpm9/qtzvuc](https://www.yuque.com/easytransfer/itfpm9/qtzvuc)\n\nModelZoo：[https://www.yuque.com/easytransfer/itfpm9/oszcof](https://www.yuque.com/easytransfer/itfpm9/oszcof)\n\nAppZoo：[https://www.yuque.com/easytransfer/itfpm9/ky6hky](https://www.yuque.com/easytransfer/itfpm9/ky6hky)\n\nAPI docs：[http://atp-modelzoo-sh.oss-cn-shanghai.aliyuncs.com/release/eztransfer_docs/html/index.html](http://atp-modelzoo-sh.oss-cn-shanghai.aliyuncs.com/release/eztransfer_docs/html/index.html)\n\n\n# Contact Us\nScan the following QR codes to join Dingtalk discussion group. The group discussions are most in Chinese, but English is also welcomed.\n\n\u003cimg src=\"https://cdn.nlark.com/yuque/0/2020/png/2480469/1600310258842-d7121051-32f1-494b-a7a5-a35ede74b6c4.png#align=left\u0026display=inline\u0026height=352\u0026margin=%5Bobject%20Object%5D\u0026name=image.png\u0026originHeight=1178\u0026originWidth=1016\u0026size=312154\u0026status=done\u0026style=none\u0026width=304\" width=\"300\"/\u003e\n\nAlso we can scan the following QR code to join wechat discussion group.\n\n\u003cimg src=\"https://intranetproxy.alipay.com/skylark/lark/0/2020/jpeg/226643/1603306190699-56be6895-1287-42e3-b8a7-f957b1a4d7b7.jpeg#align=left\u0026display=inline\u0026height=352\u0026margin=%5Bobject%20Object%5D\u0026name=IMG_2129.JPG\u0026originHeight=1178\u0026originWidth=1016\u0026size=312154\u0026status=done\u0026style=none\u0026width=304\" width=\"300\"/\u003e\n\n\n# Citation\n\n```text\n@article{easytransfer,\n    author = {Minghui Qiu and \n\t    Peng Li and \n\t    Chengyu Wang and \n\t    Haojie Pan and \n\t    An Wang and \n\t    Cen Chen and \n\t    Xianyan Jia and \n\t    Yaliang Li and \n\t    Jun Huang and \n\t    Deng Cai and \n\t    Wei Lin},\n    title = {EasyTransfer - A Simple and Scalable Deep Transfer Learning Platform for NLP Applications\n},\n    journal = {CIKM 2021},\n    url = {https://arxiv.org/abs/2011.09463},\n    year = {2021}\n}\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003cimg src=\"https://cdn.nlark.com/yuque/0/2020/png/2480469/1600401425964-828d6ffe-90d7-4cda-9b76-b9f17e35f11f.png#align=left\u0026display=inline\u0026height=188\u0026margin=%5Bobject%20Object%5D\u0026name=image.png\u0026originHeight=608\u0026originWidth=649\u0026size=41423\u0026status=done\u0026style=none\u0026width=201\" width=\"200\"/\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://www.yuque.com/easytransfer/itfpm9/ah0z6o\"\u003e\n        \u003cimg src=\"https://cdn.nlark.com/yuque/0/2020/svg/2480469/1600310258840-bfe6302e-d934-409d-917c-8eab455675c1.svg\" height=\"24\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falibaba%2Feasytransfer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falibaba%2Feasytransfer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falibaba%2Feasytransfer/lists"}