Skip to content

Commit

Permalink
Migrate Wit workflows to new data design, delete deprecated Word Tagg…
Browse files Browse the repository at this point in the history
…ing tasks, models and data handlers (facebookresearch#910)

Summary:
Pull Request resolved: facebookresearch#910

as title

Differential Revision: D16827032

fbshipit-source-id: 29f9e7eebcd25accd93b39c14b3cdf6d3efcd3e9
  • Loading branch information
geof90 authored and facebook-github-bot committed Sep 10, 2019
1 parent ed6191e commit 1a6daaa
Show file tree
Hide file tree
Showing 18 changed files with 141 additions and 895 deletions.
4 changes: 0 additions & 4 deletions pytext/builtin_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
SemanticParsingTask,
SemanticParsingTask_Deprecated,
SeqNNTask,
SeqNNTask_Deprecated,
SquadQATask,
WordTaggingTask,
WordTaggingTask_Deprecated,
)


Expand Down Expand Up @@ -84,9 +82,7 @@ def register_builtin_tasks():
SemanticParsingTask,
SemanticParsingTask_Deprecated,
SeqNNTask,
SeqNNTask_Deprecated,
SquadQATask,
WordTaggingTask,
WordTaggingTask_Deprecated,
)
)
14 changes: 1 addition & 13 deletions pytext/config/config_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ def old_tasks_deprecated(json_config):
deprecate(json_config, "ShallowTaggingTask")
deprecate(json_config, "SpanClassificationTask")
deprecate(json_config, "TreeParserTask")
deprecate(json_config, "WordTaggingTask")

return json_config

Expand Down Expand Up @@ -385,7 +384,6 @@ def new_tasks_rename(json_config):
"QueryDocumentPairwiseRankingModel",
"QueryDocumentPairwiseRankingModel_Deprecated",
)
rename(json_config, "WordTaggingModel", "WordTaggingModel_Deprecated")
# New
rename(json_config, "NewDocModel", "DocModel")
rename(json_config, "NewDocRegressionModel", "DocRegressionModel")
Expand Down Expand Up @@ -461,19 +459,15 @@ def v12_to_v13(json_config):

[(task_name, task)] = json_config["task"].items()
if task_name not in (
"EnsembleTask_Deprecated",
"EnsembleTask",
"DocClassificationTask_Deprecated",
"DocumentClassificationTask",
"PairwiseClassificationTask",
"SeqNNTask_Deprecated",
"SeqNNTask",
"ShallowClassificationTask_Deprecated",
"KDDocClassificationTask_Deprecated",
"ElmoDocClassificationTask_Deprecated",
"PairwiseAttentionClassificationTask_Deprecated",
"ElmoFineTunePairwiseClassificationTask_Deprecated",
"ElmoKDClassificationTask_Deprecated",
"XLMDocumentClassification",
"XLMPairClassification",
"NewBertClassificationTask",
Expand Down Expand Up @@ -542,13 +536,7 @@ def update_model_config(model_config):

@register_adapter(from_version=14)
def flatten_deprecated_ensemble_config(json_config):
[(task_name, task)] = json_config["task"].items()
if task_name != "EnsembleTask_Deprecated":
return json_config

# Joint ensemble model is deleted, so we no longer have a union type, hence
# we flatten the config.
task["model"] = task["model"]["BaggingDocEnsemble_Deprecated"]
# Deprecated ensemble is removed from codebase, so this is now just a no-op
return json_config


Expand Down
104 changes: 0 additions & 104 deletions pytext/config/test/json_config/v6.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,109 +24,5 @@
},
"version": 6
}
},
{
"original": {
"task": {
"WordTaggingTask": {
"data_handler": {
"train_path": "tests/data/train_data_tiny.tsv",
"eval_path": "tests/data/test_data_tiny.tsv",
"test_path": "tests/data/test_data_tiny.tsv"
}
}
},
"version": 5
},
"adapted": {
"task": {
"WordTaggingTask_Deprecated": {
"data_handler": {
"train_path": "tests/data/train_data_tiny.tsv",
"eval_path": "tests/data/test_data_tiny.tsv",
"test_path": "tests/data/test_data_tiny.tsv"
}
}
},
"version": 6
}
},
{
"original": {
"task": {
"WordTaggingTask": {
"data_handler": {
"train_path": "tests/data/train_data_tiny.tsv",
"eval_path": "tests/data/test_data_tiny.tsv",
"test_path": "tests/data/test_data_tiny.tsv"
}
}
},
"version": 5
},
"adapted": {
"task": {
"WordTaggingTask_Deprecated": {
"data_handler": {
"train_path": "tests/data/train_data_tiny.tsv",
"eval_path": "tests/data/test_data_tiny.tsv",
"test_path": "tests/data/test_data_tiny.tsv"
}
}
},
"version": 6
}
},
{
"original": {
"task": {
"WordTaggingTask": {
"data_handler": {
"train_path": "tests/data/train_data_tiny.tsv",
"eval_path": "tests/data/test_data_tiny.tsv",
"test_path": "tests/data/test_data_tiny.tsv"
}
}
},
"version": 5
},
"adapted": {
"task": {
"WordTaggingTask_Deprecated": {
"data_handler": {
"train_path": "tests/data/train_data_tiny.tsv",
"eval_path": "tests/data/test_data_tiny.tsv",
"test_path": "tests/data/test_data_tiny.tsv"
}
}
},
"version": 6
}
},
{
"original": {
"task": {
"SeqNNTask": {
"data_handler": {
"train_path": "tests/data/train_data_tiny.tsv",
"eval_path": "tests/data/test_data_tiny.tsv",
"test_path": "tests/data/test_data_tiny.tsv"
}
}
},
"version": 5
},
"adapted": {
"task": {
"SeqNNTask_Deprecated": {
"data_handler": {
"train_path": "tests/data/train_data_tiny.tsv",
"eval_path": "tests/data/test_data_tiny.tsv",
"test_path": "tests/data/test_data_tiny.tsv"
}
}
},
"version": 6
}
}
]
4 changes: 0 additions & 4 deletions pytext/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from .disjoint_multitask_data import DisjointMultitaskData
from .disjoint_multitask_data_handler import DisjointMultitaskDataHandler
from .doc_classification_data_handler import DocClassificationDataHandler, RawData
from .joint_data_handler import JointModelDataHandler
from .seq_data_handler import SeqModelDataHandler
from .tensorizers import Tensorizer


Expand All @@ -33,11 +31,9 @@
"DocClassificationDataHandler",
"EvalBatchSampler",
"generator_iterator",
"JointModelDataHandler",
"PoolingBatcher",
"RandomizedBatchSampler",
"RawData",
"RoundRobinBatchSampler",
"SeqModelDataHandler",
"Tensorizer",
]
177 changes: 0 additions & 177 deletions pytext/data/joint_data_handler.py

This file was deleted.

Loading

0 comments on commit 1a6daaa

Please sign in to comment.