[MASK]it -Efficient pre-trained encoder adaption leveraging the [MASK]
Project description
[MASK]-It - Lightweight framework for efficient encoder model fine-tuning
Install
requires python 3.10 or above
pip install maskit-learn
Usage
Define task
# task and model
classes = ['happy', 'sad']
verbalizer_map = {'happy':['happy', 'fun'],
'sad':['sad', 'cry']
model_name = 'google-bert/bert-base-uncased'
Select pre-trained model
from maskit.model import maskitModel
model = maskitModel(model_name=model_name,
verbalizer_map=verbalizer_map)
Load dataset
text = ['I am so happy today that I cannot stay still',
'I am very very sad unfortunately']
labels = [1,0]
template = '{text}. This sentence is: [MASK]'
dataset = maskitDataset(text, labels, model_name, template)
dataloader = DataLoader(dataset=dataset, batch_size=2)
Inference
batch = next(iter(dataloader))
output = model(**batch)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maskit_learn-0.0.1.tar.gz.
File metadata
- Download URL: maskit_learn-0.0.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5e9d2d5c945da1cd9bd813e1a646f914d39a802bf3c3b31cc3775a2fbb225d8
|
|
| MD5 |
0f8ab9e588436cfc93b7459a3686718c
|
|
| BLAKE2b-256 |
8fae78bc674fa103927eccfb5eb21cf7b8530fb6e69fff07c8128192fd0529d2
|
Provenance
The following attestation bundles were made for maskit_learn-0.0.1.tar.gz:
Publisher:
publish.yml on eugeniaalleva/maskit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maskit_learn-0.0.1.tar.gz -
Subject digest:
f5e9d2d5c945da1cd9bd813e1a646f914d39a802bf3c3b31cc3775a2fbb225d8 - Sigstore transparency entry: 190475719
- Sigstore integration time:
-
Permalink:
eugeniaalleva/maskit@40f9ba48bd64356c8ed0eefa1ce0303f1022115c -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/eugeniaalleva
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@40f9ba48bd64356c8ed0eefa1ce0303f1022115c -
Trigger Event:
push
-
Statement type:
File details
Details for the file maskit_learn-0.0.1-py3-none-any.whl.
File metadata
- Download URL: maskit_learn-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9735406af08c98fe4b7d2dbc17c0c3363e16866bb294f0a12ed9b2e79c9d3ba2
|
|
| MD5 |
49b739842af6a3af7fb1580105120d40
|
|
| BLAKE2b-256 |
31ac265c18bba389244a4da06611ff29ac3a97c4e6ab496cfa8fc477b9d2a201
|
Provenance
The following attestation bundles were made for maskit_learn-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on eugeniaalleva/maskit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maskit_learn-0.0.1-py3-none-any.whl -
Subject digest:
9735406af08c98fe4b7d2dbc17c0c3363e16866bb294f0a12ed9b2e79c9d3ba2 - Sigstore transparency entry: 190475724
- Sigstore integration time:
-
Permalink:
eugeniaalleva/maskit@40f9ba48bd64356c8ed0eefa1ce0303f1022115c -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/eugeniaalleva
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@40f9ba48bd64356c8ed0eefa1ce0303f1022115c -
Trigger Event:
push
-
Statement type: