-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generalist dataloader created with sentiment as additional example task
- Loading branch information
1 parent
7f607d1
commit 5e6c8f8
Showing
16 changed files
with
963 additions
and
64 deletions.
There are no files selected for viewing
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
defaults: | ||
- default.yaml | ||
- parrot.yaml |
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
reliability_score/configs/custom_model/roberta_base_sentiment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## below parameters are self-explanatory | ||
model_name: "cardiffnlp/twitter-xlm-roberta-base-sentiment" | ||
model_type: "discriminative" ## you can only have following types: "encode-decode","decoder-only","bart","discriminative","shared","hybrid","t5", | ||
huggingface_class: null | ||
decoder_model_name: null | ||
model_path: null ## provide the path if you have custom trained model using transformers library | ||
tie_embeddings: false | ||
label: null | ||
tie_encoder_decoder: false | ||
pipeline: null | ||
|
||
additional_model_inputs: null ## specify the additional pre-defined input to model like bean_search for generative models | ||
|
||
tokenizer: | ||
model_name: ${..model_name} ## only specify the name from huggingface if it's different than the actual model | ||
label2id: ## this will vary based on the evaluation data, please refer to the your selected dataset config | ||
negative: 0 | ||
neutral: 1 | ||
positive: 2 | ||
args: | ||
truncation: true | ||
padding: "max_length" | ||
|
||
## use following dataset pre-processing steps | ||
data_processing: | ||
header: null ## prompt header for input data? | ||
footer: null ## prompt header for signling output? | ||
separator: " [SEP] " ## what is separator token? leave `null` for generative models | ||
columns: | ||
null | ||
## you should define this only for generative or for prompt eng. models as shown below | ||
# premise: null | ||
# hypothesis: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
_target_: reliability_score.datamodules.mnli_datamodule.MNLIDataModule | ||
_target_: reliability_score.datamodules.common_datamodule.GeneralDataModule | ||
data_dir: ${paths.data_dir} | ||
batch_size: 1 | ||
num_workers: 0 | ||
pin_memory: False | ||
tokenizer_data: ${custom_model.tokenizer} | ||
model_type: ${custom_model.model_type} | ||
data_processing: ${custom_model.data_processing} | ||
dataset_specific_args: | ||
label_conversion: null | ||
label2id: | ||
0: "entailment" | ||
1: "neutral" | ||
2: "contradiction" | ||
cols: ["premise", "hypothesis"] | ||
name: multi_nli | ||
split: validation_matched | ||
remove_cols: ["promptID", "pairID"] | ||
label_col: "label" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
_target_: reliability_score.datamodules.common_datamodule.GeneralDataModule | ||
data_dir: ${paths.data_dir} | ||
batch_size: 1 | ||
num_workers: 0 | ||
pin_memory: False | ||
tokenizer_data: ${custom_model.tokenizer} | ||
model_type: ${custom_model.model_type} | ||
data_processing: ${custom_model.data_processing} | ||
dataset_specific_args: | ||
label_conversion: | ||
0: 0 | ||
2: 1 | ||
4: 2 | ||
label2id: | ||
0: "negative" | ||
1: "neutral" | ||
2: "positive" | ||
cols: ["text"] | ||
name: sentiment140 | ||
split: test | ||
remove_cols: ["query", "user", "date"] | ||
label_col: "sentiment" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# @package _global_ | ||
|
||
# to execute this experiment run: | ||
# python train.py experiment=example | ||
|
||
defaults: | ||
- override /augmentation: sentiment.yaml | ||
- override /datamodule: sentiment140.yaml | ||
- override /model: inference.yaml | ||
- override /callbacks: general_evals.yaml | ||
- override /trainer: default.yaml | ||
- override /custom_model: bert_base_uncased.yaml | ||
- override /logger: csv.yaml | ||
|
||
# all parameters below will be merged with parameters from default configurations set above | ||
# this allows you to overwrite only specified parameters | ||
|
||
tags: ["sentiment", "test"] | ||
|
||
seed: 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.