sgnlp.models.emotion_entailment.utils.convert_df_to_dataset¶
-
convert_df_to_dataset
(df: pandas.core.frame.DataFrame, max_seq_length: int, tokenizer: sgnlp.models.emotion_entailment.tokenization.RecconEmotionEntailmentTokenizer) → torch.utils.data.dataset.TensorDataset[source]¶ Convert pandas dataframe to TensorDataset
- Parameters
df (pd.DataFrame) – DataFrame containing ‘text’ and ‘labels’ columns
max_seq_length (int) – max sequence length
tokenizer (RecconEmotionEntailmentTokenizer) – RecconEmotionEntailmentTokenizer from sgnlp
- Returns
A tensordataset object containing all examples
- Return type
TensorDataset