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: 713f18773b47b76be8110f6d40e1284c142a8d76
  • Loading branch information
geof90 authored and facebook-github-bot committed Aug 17, 2019
1 parent 90a00c3 commit 9e724f3
Show file tree
Hide file tree
Showing 18 changed files with 124 additions and 901 deletions.
4 changes: 0 additions & 4 deletions pytext/builtin_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
SemanticParsingTask,
SemanticParsingTask_Deprecated,
SeqNNTask,
SeqNNTask_Deprecated,
SquadQATask,
WordTaggingTask,
WordTaggingTask_Deprecated,
)


Expand Down Expand Up @@ -86,9 +84,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
105 changes: 0 additions & 105 deletions pytext/config/test/json_config/v6.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,85 +25,6 @@
"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": {
Expand All @@ -129,31 +50,5 @@
},
"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,11 +14,9 @@
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 .query_document_pairwise_ranking_data_handler import (
QueryDocumentPairwiseRankingDataHandler,
)
from .seq_data_handler import SeqModelDataHandler
from .tensorizers import Tensorizer


Expand All @@ -36,12 +34,10 @@
"DocClassificationDataHandler",
"EvalBatchSampler",
"generator_iterator",
"JointModelDataHandler",
"PoolingBatcher",
"RandomizedBatchSampler",
"QueryDocumentPairwiseRankingDataHandler",
"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 9e724f3

Please sign in to comment.