Skip to content

Commit

Permalink
Rename Labeling to SequenceLabeling
Browse files Browse the repository at this point in the history
  • Loading branch information
fdalvi committed Sep 17, 2023
1 parent 280e28a commit 181c6d4
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion llmebench/datasets/ANERcorp.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def metadata():
"test": "data/sequence_tagging_ner_pos_etc/NER/AnerCorp/ANERCorp_CamelLab_test.txt",
"train": "data/sequence_tagging_ner_pos_etc/NER/AnerCorp/ANERCorp_CamelLab_train.txt",
},
"task_type": TaskType.Labeling,
"task_type": TaskType.SequenceLabeling,
"class_labels": [
"B-PERS",
"I-PERS",
Expand Down
2 changes: 1 addition & 1 deletion llmebench/datasets/Aqmar.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def metadata():
"path": "data/sequence_tagging_ner_pos_etc/NER/aqmar/AQMAR_Arabic_NER_corpus-1.0",
},
},
"task_type": TaskType.Labeling,
"task_type": TaskType.SequenceLabeling,
"class_labels": [
"B-PERS",
"I-PERS",
Expand Down
2 changes: 1 addition & 1 deletion llmebench/datasets/MGBWords.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def metadata():
"splits": {
"test": "data/sequence_tagging_ner_pos_etc/NER/mgb/MGB-words.txt"
},
"task_type": TaskType.Labeling,
"task_type": TaskType.SequenceLabeling,
"class_labels": [
"B-PERS",
"I-PERS",
Expand Down
2 changes: 1 addition & 1 deletion llmebench/datasets/QCRIDialectalArabicPOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def metadata():
},
"default": ["glf.data_5", "lev.data_5", "egy.data_5", "mgr.data_5"],
},
"task_type": TaskType.Labeling,
"task_type": TaskType.SequenceLabeling,
"class_labels": [
"ADJ",
"ADV",
Expand Down
2 changes: 1 addition & 1 deletion llmebench/datasets/WikiNewsPOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def metadata():
"test": "data/sequence_tagging_ner_pos_etc/POS/WikiNewsTruth.txt.POS.tab",
"train": "data/sequence_tagging_ner_pos_etc/POS/WikiNewsTruthDev.txt",
},
"task_type": TaskType.Labeling,
"task_type": TaskType.SequenceLabeling,
"class_labels": [
"ABBREV",
"ADJ",
Expand Down
2 changes: 1 addition & 1 deletion llmebench/datasets/XGLUEPOS.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def metadata():
"dev": "data/sequence_tagging_ner_pos_etc/POS/XGLUE/ar.dev.src-trg.txt",
"test": "data/sequence_tagging_ner_pos_etc/POS/XGLUE/ar.test.src-trg.txt",
},
"task_type": TaskType.Labeling,
"task_type": TaskType.SequenceLabeling,
"class_labels": [
"ADJ",
"ADP",
Expand Down
3 changes: 2 additions & 1 deletion llmebench/datasets/dataset_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def metadata():
Model.
"class_labels" : list (optional)
List of class labels, must be provided when `task_type` is
`Classification`, `MultiLabelClassification` or `Labeling`.
`Classification`, `MultiLabelClassification` or
`SequenceLabeling`.
"score_range" : tuple (optional)
Score range defining (min_val, max_val). Must be defined
when `task_type` is `Regression`
Expand Down
2 changes: 1 addition & 1 deletion llmebench/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
[
"Classification",
"MultiLabelClassification",
"Labeling",
"SequenceLabeling",
"QuestionAnswering",
"SequenceToSequence",
"Regression",
Expand Down
2 changes: 1 addition & 1 deletion tests/datasets/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_dataset_metadata(self):

if metadata["task_type"] in [
TaskType.Classification,
TaskType.Labeling,
TaskType.SequenceLabeling,
TaskType.MultiLabelClassification,
]:
self.assertIn("class_labels", metadata)
Expand Down
4 changes: 3 additions & 1 deletion tests/models/test_HuggingFaceInferenceAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from llmebench import Benchmark
from llmebench.models import HuggingFaceInferenceAPIModel, HuggingFaceTaskTypes

from llmebench.utils import is_fewshot_asset


class TestAssetsForHuggingFaceInferenceAPIPrompts(unittest.TestCase):
@classmethod
Expand All @@ -29,7 +31,7 @@ def test_huggingface_inference_api_prompts(self):
config = asset["config"]
dataset = config["dataset"](**config["dataset_args"])
data_sample = dataset.get_data_sample()
if "fewshot" in config["general_args"]:
if is_fewshot_asset(config, asset["module"].prompt):
prompt = asset["module"].prompt(
data_sample["input"],
[data_sample for _ in range(n_shots)],
Expand Down

0 comments on commit 181c6d4

Please sign in to comment.