What are the merges and vocab files used for in BERT-based models?
The vocab file contains a mapping from vocabulary strings and indices used for embedding lookup in the model.
The merges say how to split the input string into subword units. The algorithm is as follows: At the beginning of merging, a word split into characters and then you greedily search for neighboring symbols that can be merged (i.e., are in a list of allowed merges), you stop when there is nothing to merge and this is the subword segmentation.