Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OpenBMB/DecT
/ functions
Functions
58 in github.com/OpenBMB/DecT
⨍
Functions
58
◇
Types & classes
13
↓ 10 callers
Method
__init__
(self)
src/process_data.py:287
↓ 3 callers
Function
build_dataloader
(dataset, template, verbalizer, tokenizer, tokenizer_wrapper_class, batch_size)
src/run_dect.py:72
↓ 3 callers
Method
gather_outputs
(self, outputs: ModelOutput)
src/dect_verbalizer.py:248
↓ 3 callers
Method
process_hiddens
r"""A whole framework to process the original logits over the vocabulary, which contains four steps:
src/dect_verbalizer.py:135
↓ 3 callers
Method
process_logits
r"""A whole framework to process the original logits over the vocabulary, which contains four steps: (1) Project the logits into logits of l
src/dect_verbalizer.py:161
↓ 2 callers
Method
project
r""" Project the labels, the return value is the normalized (sum to 1) probs of label words. Args: logits (:obj:
src/dect_verbalizer.py:141
↓ 2 callers
Method
sim
(x, y, r=0, model_logits=0, model_logits_weight=1)
src/dect_verbalizer.py:263
↓ 2 callers
Method
test
(self, ckpt: Optional[str] = None)
src/dect_trainer.py:94
↓ 1 callers
Method
add_prefix
r"""Add prefix to label words. For example, if a label words is in the middle of a template, the prefix should be ``' '``. Args:
src/dect_verbalizer.py:82
↓ 1 callers
Method
aggregate
r"""Use weight to aggregate the logits of label words. Args: label_words_logits(:obj:`torch.Tensor`): The logits of the label wor
src/dect_verbalizer.py:214
↓ 1 callers
Method
calibrate
r""" Args: label_words_probs (:obj:`torch.Tensor`): The probability distribution of the label words with the shape of [``
src/dect_verbalizer.py:226
↓ 1 callers
Function
download_and_extract
(task, data_dir)
datasets/download_glue_data.py:41
↓ 1 callers
Function
download_diagnostic
(data_dir)
datasets/download_glue_data.py:106
↓ 1 callers
Method
fit
(self, ckpt: Optional[str] = None)
src/dect_trainer.py:84
↓ 1 callers
Function
format_mrpc
(data_dir, path_to_data)
datasets/download_glue_data.py:52
↓ 1 callers
Method
generate_parameters
r"""In basic manual template, the parameters are generated from label words directly. In this implementation, the label_words should not be to
src/dect_verbalizer.py:107
↓ 1 callers
Function
get_tasks
(task_names)
datasets/download_glue_data.py:115
↓ 1 callers
Method
inference_epoch
(self, split: str)
src/dect_trainer.py:57
↓ 1 callers
Method
load_data
(file)
src/process_data.py:344
↓ 1 callers
Function
load_dataset
r"""A dataset loader using a global config. It will load the train, valid, and test set (if exists) simulatenously.
src/process_data.py:11
↓ 1 callers
Function
load_model
(name, size, path)
src/run_dect.py:37
↓ 1 callers
Method
loss_func
(self, x, model_logits, labels)
src/dect_verbalizer.py:268
↓ 1 callers
Function
main
()
src/run_dect.py:88
↓ 1 callers
Function
main
(arguments)
datasets/download_glue_data.py:126
↓ 1 callers
Method
normalize
Given logits regarding the entire vocabulary, return the probs over the label words set. Args: logits (:obj:`Ten
src/dect_verbalizer.py:199
↓ 1 callers
Method
run
(self, ckpt: Optional[str] = None)
src/dect_trainer.py:100
↓ 1 callers
Method
train_proto
(self, model, dataloader, calibrate_dataloader)
src/dect_verbalizer.py:321
Method
__init__
(self)
src/process_data.py:53
Method
__init__
(self)
src/process_data.py:79
Method
__init__
(self)
src/process_data.py:107
Method
__init__
(self)
src/process_data.py:131
Method
__init__
(self)
src/process_data.py:157
Method
__init__
(self)
src/process_data.py:184
Method
__init__
(self)
src/process_data.py:215
Method
__init__
(self)
src/process_data.py:239
Method
__init__
(self)
src/process_data.py:265
Method
__init__
(self)
src/process_data.py:312
Method
__init__
(self, tokenizer: Optional[PreTrainedTokenizer], classes: Optional[List] =
src/dect_verbalizer.py:36
Method
__init__
(self, model: PromptForClassification, train_dataloader: Optional[PromptDat
src/dect_trainer.py:32
Method
get_examples
(self, data_dir, split)
src/process_data.py:57
Method
get_examples
(self, data_dir, split)
src/process_data.py:83
Method
get_examples
(self, data_dir, split)
src/process_data.py:111
Method
get_examples
(self, data_dir, split)
src/process_data.py:135
Method
get_examples
(self, data_dir, split)
src/process_data.py:161
Method
get_examples
(self, data_dir, split)
src/process_data.py:189
Method
get_examples
(self, data_dir, split)
src/process_data.py:219
Method
get_examples
(self, data_dir, split)
src/process_data.py:243
Method
get_examples
(self, data_dir, split)
src/process_data.py:269
Method
get_examples
(self, data_dir, split)
src/process_data.py:291
Method
get_examples
(self, data_dir, split)
src/process_data.py:325
Method
get_test_labels_only
(data_dir, dirname)
src/process_data.py:174
Method
group_parameters_proto
r"""Include the last layer's parameters
src/dect_verbalizer.py:72
Method
inference_epoch_end
(self, outputs)
src/dect_trainer.py:69
Method
inference_step
(self, batch, batch_idx)
src/dect_trainer.py:51
Method
on_label_words_set
(self)
src/dect_verbalizer.py:77
Method
process_outputs
(self, outputs: Union[torch.Tensor, torch.Tensor], batch: Union[Dict, InputFeatures], **kwargs)
src/dect_verbalizer.py:243
Method
test
(self, model, dataloader)
src/dect_verbalizer.py:276
Method
training_step
(self, batch, batch_idx)
src/dect_trainer.py:79