add space to metainfo

This commit is contained in:
智丞
2022-06-28 15:22:20 +08:00
parent 1e361a4ad1
commit a1750095c9
5 changed files with 14 additions and 4 deletions

View File

@@ -16,6 +16,7 @@ class Models(object):
palm = 'palm-v2'
structbert = 'structbert'
veco = 'veco'
space = 'space'
# audio models
sambert_hifi_16k = 'sambert-hifi-16k'
@@ -98,6 +99,8 @@ class Preprocessors(object):
token_cls_tokenizer = 'token-cls-tokenizer'
nli_tokenizer = 'nli-tokenizer'
sen_cls_tokenizer = 'sen-cls-tokenizer'
dialog_intent_preprocessor = 'dialog-intent-preprocessor'
dialog_modeling_preprocessor = 'dialog-modeling-preprocessor'
# audio preprocessor
linear_aec_fbank = 'linear-aec-fbank'

View File

@@ -1,6 +1,7 @@
import os
from typing import Any, Dict
from ....metainfo import Models
from ....preprocessors.space.fields.intent_field import IntentBPETextField
from ....trainers.nlp.space.trainer.intent_trainer import IntentTrainer
from ....utils.config import Config
@@ -13,7 +14,8 @@ from .model.model_base import SpaceModelBase
__all__ = ['SpaceForDialogIntentModel']
@MODELS.register_module(Tasks.dialog_intent_prediction, module_name=r'space')
@MODELS.register_module(
Tasks.dialog_intent_prediction, module_name=Models.space)
class SpaceForDialogIntentModel(Model):
def __init__(self, model_dir: str, *args, **kwargs):

View File

@@ -1,6 +1,7 @@
import os
from typing import Any, Dict, Optional
from ....metainfo import Models
from ....preprocessors.space.fields.gen_field import MultiWOZBPETextField
from ....trainers.nlp.space.trainer.gen_trainer import MultiWOZTrainer
from ....utils.config import Config
@@ -13,7 +14,7 @@ from .model.model_base import SpaceModelBase
__all__ = ['SpaceForDialogModelingModel']
@MODELS.register_module(Tasks.dialog_modeling, module_name=r'space')
@MODELS.register_module(Tasks.dialog_modeling, module_name=Models.space)
class SpaceForDialogModelingModel(Model):
def __init__(self, model_dir: str, *args, **kwargs):

View File

@@ -3,6 +3,7 @@
import os
from typing import Any, Dict
from ...metainfo import Preprocessors
from ...utils.config import Config
from ...utils.constant import Fields, ModelFile
from ...utils.type_assert import type_assert
@@ -13,7 +14,8 @@ from .fields.intent_field import IntentBPETextField
__all__ = ['DialogIntentPredictionPreprocessor']
@PREPROCESSORS.register_module(Fields.nlp, module_name=r'space-intent')
@PREPROCESSORS.register_module(
Fields.nlp, module_name=Preprocessors.dialog_intent_preprocessor)
class DialogIntentPredictionPreprocessor(Preprocessor):
def __init__(self, model_dir: str, *args, **kwargs):

View File

@@ -3,6 +3,7 @@
import os
from typing import Any, Dict
from ...metainfo import Preprocessors
from ...utils.config import Config
from ...utils.constant import Fields, ModelFile
from ...utils.type_assert import type_assert
@@ -13,7 +14,8 @@ from .fields.gen_field import MultiWOZBPETextField
__all__ = ['DialogModelingPreprocessor']
@PREPROCESSORS.register_module(Fields.nlp, module_name=r'space-modeling')
@PREPROCESSORS.register_module(
Fields.nlp, module_name=Preprocessors.dialog_modeling_preprocessor)
class DialogModelingPreprocessor(Preprocessor):
def __init__(self, model_dir: str, *args, **kwargs):