easynlp.appzoo¶
Data Augmentation¶
Feature Vectorization¶
Language Modeling¶
Sequence Classification¶
- 
class 
easynlp.appzoo.sequence_classification.model.SequenceClassification(pretrained_model_name_or_path=None, **kwargs)[source]¶ 
- 
class 
easynlp.appzoo.sequence_classification.model.DistillatorySequenceClassification(pretrained_model_name_or_path=None, **kwargs)[source]¶ 
- 
class 
easynlp.appzoo.sequence_classification.model.SequenceMultiLabelClassification(pretrained_model_name_or_path=None, **kwargs)[source]¶ The application class for multi-label text classification
GEEP Classification¶
- 
class 
easynlp.appzoo.geep_classification.model.MultiHeadedAttention(hidden_size, heads_num, dropout)[source]¶ Each head is a self-attention operation. self-attention refers to https://arxiv.org/pdf/1706.03762.pdf
- 
forward(key, value, query)[source]¶ Parameters: - key -- [batch_size x seq_length x hidden_size]
 - value -- [batch_size x seq_length x hidden_size]
 - query -- [batch_size x seq_length x hidden_size]
 - mask -- [batch_size x 1 x seq_length x seq_length]
 
Returns: [batch_size x seq_length x hidden_size]
Return type: output
- 
 
- 
class 
easynlp.appzoo.geep_classification.model.GEEPClassifier(input_size, labels_num)[source]¶ Classifiers for early exit.
- 
easynlp.appzoo.geep_classification.model.attr_set(classifiers, key, val)[source]¶ Load weight for classifiers.
- 
class 
easynlp.appzoo.geep_classification.model.GEEPClassification(pretrained_model_name_or_path, user_defined_parameters, **kwargs)[source]¶ GEEPClassification: a hybrid architechture including a BERT-ish backbone and multiple early-exit classifiers. You sholud provide following user_defined_parameters: user_defined_parameters['geep_exit_num']: Required for training. The number of early-exit classifiers, these classifiers receive each Transformer Layer output from bootom to top. user_defined_parameters['geep_threshold']: Required for inference, between 0 and 1. It is the threshold for the normalized cross entropy. Smaller value for higher accuracy and slower inference time.
Sequence Labeling¶
Text Matching¶
- 
class 
easynlp.appzoo.text_match.model.TextMatch(pretrained_model_name_or_path=None, **kwargs)[source]¶ 
- 
class 
easynlp.appzoo.text_match.model.TextMatchTwoTowerV1(pretrained_model_name_or_path=None, **kwargs)[source]¶ 
- 
class 
easynlp.appzoo.text_match.model.TextMatchTwoTower(pretrained_model_name_or_path=None, **kwargs)[source]¶ 
- 
class 
easynlp.appzoo.text_match.model.DistillatoryTextMatch(pretrained_model_name_or_path=None, **kwargs)[source]¶