class_docstr: Byte-pair encoding implementation in TorchScript.
  
  vocab_file should be a file-like object separated by newlines, where each line
  consists of a word and a count separated by whitespace. Words in the vocab
  therefore can't contain space (according to python regex \s). The vocab file
  should be sorted according to the importance of each token, and they will be
  merged in this priority; the actual score values are irrelevant.
  
  eow_token should be a string that is appended to the last character and token,
  and that token is used at each step in the process and returned at the end.
  You should set this to be consistent with the EOW signature used however you
  generated your ScriptBPE vocab file.
  
  >>> import io
  >>> vocab_file = io.StringIO('''
  hello_EOW 20
  world_EOW 18
  th  17
  is_EOW 16
  bpe_EOW 15
  ! 14
  h 13
  t 6
  s_EOW 2
  i -1
  ii -2
  ''')
  >>> bpe = ScriptBPE.from_vocab_file(vocab_file)
  >>> bpe.tokenize(["hello", "world", "this", "is", "bpe"])
  ["hello_EOW", "world_EOW", "th", "is_EOW", "is_EOW", "bpe_EOW"]
  >>> bpe.tokenize(["iiiis"])
  ["ii", "i", "is_EOW"]
class_docstr_tok: ["Byte-pair","encoding","implementation","in","TorchScript",".","vocab_file","should","be","a","file-like","object","separated","by","newlines",",","where","each","line","consists","of","a","word","and","a","count","separated","by","whitespace",".","Words","in","the","vocab","therefore","ca","n't","contain","space","(","according","to","python","regex","\\s",")",".","The","vocab","file","should","be","sorted","according","to","the","importance","of","each","token",",","and","they","will","be","merged","in","this","priority",";","the","actual","score","values","are","irrelevant",".","eow_token","should","be","a","string","that","is","appended","to","the","last","character","and","token",",","and","that","token","is","used","at","each","step","in","the","process","and","returned","at","the","end",".","You","should","set","this","to","be","consistent","with","the","EOW","signature","used","however","you","generated","your","ScriptBPE","vocab","file",".",">",">",">","import","io",">",">",">","vocab_file","=","io.StringIO","(","``","'","hello_EOW","20","world_EOW","18","th","17","is_EOW","16","bpe_EOW","15","!","14","h","13","t","6","s_EOW","2","i","-1","ii","-2","''","'",")",">",">",">","bpe","=","ScriptBPE.from_vocab_file","(","vocab_file",")",">",">",">","bpe.tokenize","(","[","``","hello","''",",","``","world","''",",","``","this","''",",","``","is","''",",","``","bpe","''","]",")","[","``","hello_EOW","''",",","``","world_EOW","''",",","``","th","''",",","``","is_EOW","''",",","``","is_EOW","''",",","``","bpe_EOW","''","]",">",">",">","bpe.tokenize","(","[","``","iiiis","''","]",")","[","``","ii","''",",","``","i","''",",","``","is_EOW","''","]"]
code: def from_vocab_filename(cls, vocab_filename: str) -> "ScriptBPE":
      with PathManager.open(vocab_filename) as vocab_file:
          return cls(cls.load_vocab(vocab_file))
  
file_path: pytext/pytext/torchscript/tokenizer/bpe.py
imports: import io
  from typing import Dict, List
  import torch
  from pytext.torchscript.utils import utf8_chars
  from pytext.utils.file_io import PathManager
label_desc: Use image node_id 3 for calling the ScriptBPE obj's underlying member method code with example usage: obj.from_vocab_filename(cls, vocab_filename) and returns: cls