microsoft / nlp-recipes

Natural Language Processing Best Practices & Examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Docstring typo and missing at transformers.sequence_classification.Processor.text_pair_transform

loomlike opened this issue · comments

Description

Since the issues are tiny, I put two issues at one github-issue:

  1. Typo at transformers.sequence_classification.Processor.text_pair_transform docstring,
 @staticmethod
    def text_pair_transform(text_1, text_2, tokenizer, max_len=MAX_SEQ_LEN):
        """
        Text transformation function for sentence pair classification.
        The function can be passed to a map-style PyTorch DataSet.

        Args:
            text_1 (str): Input text 1.
            text_1 (str): Input text 2.

second parameter should be text_2

  1. create_dataloader_from_df doesn't have a docstring. Would be nice to have the docstring about argument and how to use the function since the function generates either single-sequence classification or sequence-pair classification based on the arguments.

Expected behavior (i.e. solution)

  1. Correct parameter name at text_pair_transform
  2. Docstring at create_dataloader_from_df