ProSem - Probing and Classifying Semantic Spans
Project description
CLTrier ProSem
Usage
from cltrier_prosem import Pipeline
# init pipeline object (load model, data, trainer)
pipeline = Pipeline({
'encoder': {
'model': 'deepset/gbert-base', # huggingface model slug
},
'dataset': {
'path': './path/data', # path to data directory (containing train/test.parquet)
'text_column': 'text', # column containing src text
'label_column': 'label', # column containing target label
'label_classes': ['class_1', 'class_2'], # list of target classes
},
'classifier': {
'hid_size': 512, # size of classifier perceptron
'dropout': 0.2, # dropout value
},
'pooler': {
'form': 'cls',
# type of pooling, possible values:
# 'cls', 'sent_mean', 'subword_{first|last|mean|min|max}'
# if subword probing used
'span_columns': ['span']
},
'trainer': {
'num_epochs': 5, # number of training epochs
'batch_size': 32, # batch size in both training and evaluation
'learning_rate': 1e-3, # trainer learning rate
'export_path': './path/output', # output path for logging and results
},
})
# call pipeline object (training and evaluation)
pipeline()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cltrier_prosem-0.4.1.tar.gz
(13.1 MB
view details)
Built Distribution
File details
Details for the file cltrier_prosem-0.4.1.tar.gz
.
File metadata
- Download URL: cltrier_prosem-0.4.1.tar.gz
- Upload date:
- Size: 13.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75f0fae321e0a1088dae012c650d13d7e6581320d8c32d5a657a0e6f9c2690c8 |
|
MD5 | ebdf825857a29c3550ca27ea49ee8709 |
|
BLAKE2b-256 | 836b032b6410e2060f9853401f6823884f143d49234b0c361f1280d0487be4ce |
Provenance
File details
Details for the file cltrier_prosem-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: cltrier_prosem-0.4.1-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1586e07816b987a47a60465b58ff9015caa2e13a333ff2f2f04163d40d0fe35a |
|
MD5 | 78a853ce5828a90a59c10f6d2a4a3fc9 |
|
BLAKE2b-256 | c0eef8f8b1c56fb6a2126a3faccc0f3114261bf159ad2aea21c22406f9ee0142 |