This toolkit improves the performance of HuggingFace transformer models on downstream NLP tasks, by domain-adapting models to the target domain of said NLP tasks (e.g. BERT -> LawBERT).
The overall Domain Adaptation framework can be broken down into three phases:
- Data Selection
Select a relevant subset of documents from the in-domain corpus that is likely to be beneficial for domain pre-training (see below)
- Vocabulary Augmentation
Extending the vocabulary of the transformer model with domain specific-terminology
- Domain Pre-Training
Continued pre-training of transformer model on the in-domain corpus to learn linguistic nuances of the target domain
After a model is domain-adapted, it can be fine-tuned on the downstream NLP task of choice, like any pre-trained transformer model.
Components
This toolkit provides two classes, DataSelector and VocabAugmentor, to simplify the Data Selection and Vocabulary Augmentation steps respectively.
Installation
This package was developed on Python 3.6+ and can be downloaded using pip:
pip install transformers-domain-adaptation
Features
- Compatible with the HuggingFace ecosystem:
transformers 4.xtokenizersdatasets
Usage
Please refer to our Colab guide!
Results
TODO
Metadata
Release files for transformers-domain-adaptation 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| transformers-domain-adaptation-0.3.1.tar.gz | 14.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| transformers_domain_adaptation-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.8 kB
Release files / transformers-domain-adaptation-0.3.1.tar.gz
| Download URL | transformers-domain-adaptation-0.3.1.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
10a1e32d6586d9204a1e768dfa2937a123260bfc56bf15f49dc56a4be548c01c
|
|
BLAKE2b-256 checksum How to use checksums |
dcaf296e3fd7d68448de27996613819686d99a8d1bf7f396269b54065342b56b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9
|
Release files / transformers_domain_adaptation-0.3.1-py3-none-any.whl
| Download URL | transformers_domain_adaptation-0.3.1-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
923d29a46cc4a94b5a6f6cbbfe593ee80b73de7cd782097858384863bca2daa1
|
|
BLAKE2b-256 checksum How to use checksums |
42579aad30bea5bdd398861151d4b42f5287a517f0d175cdcfe236ab9743d496
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9
|