original_docstring: Update word and tag vocabulary from dataset
      Args:
          txt_path: (string) path to file, one sentence per line
          vocab: (dict or Counter) with update method
      Returns:
          dataset_size: (int) number of elements in the dataset
      
docstring: Update word and tag vocabulary from dataset
docstring_tokens: Update word and tag vocabulary from dataset
code: def update_label(txt_path, labels):
      """Update word and tag vocabulary from dataset
      Args:
          txt_path: (string) path to file, one sentence per line
          vocab: (dict or Counter) with update method
      Returns:
          dataset_size: (int) number of elements in the dataset
      """
      with open(txt_path, "r", encoding="utf8") as f:
          for i, line in enumerate(f):
              li = line.strip()
              li = li.split("__label__")
              for l in li[1:]:
                  punctuation = r"""0123456789"""
                  text = re.sub(r'[{}]+'.format(punctuation), ' ', str(l))
                  text = ' '.join(text.split())
                  text = text.lower()
                  text = ' '.join(text.split("\x01_"))
                  text = ' '.join(text.split())
                  labels.append(text.strip())
code_tokens: def update_label ( txt_path , labels ) : with open ( txt_path , "r" , encoding = "utf8" ) as f : for i , line in enumerate ( f ) : li = line . strip ( ) li = li . split ( "__label__" ) for l in li [ 1 : ] : punctuation = r"""0123456789""" text = re . sub ( r'[{}]+' . format ( punctuation ) , ' ' , str ( l ) ) text = ' ' . join ( text . split ( ) ) text = text . lower ( ) text = ' ' . join ( text . split ( "\x01_" ) ) text = ' ' . join ( text . split ( ) ) labels . append ( text . strip ( ) )
short_docstring: Update word and tag vocabulary from dataset
short_docstring_tokens: Update word and tag vocabulary from dataset
comment: """Update word and tag vocabulary from dataset
      Args:
          txt_path: (string) path to file, one sentence per line
          vocab: (dict or Counter) with update method
      Returns:
          dataset_size: (int) number of elements in the dataset
      """