Convert SentencePiece .vocab format to OpenNMT-py .onmt_vocab format

Hi, Iʻm looking for a Python script to convert SentencePiece .vocab files to OpenNMT-py .onmt_vocab format. SentencePiece vocab files have negative values and we need positive values for the frequency of the words when using OpenNMT-py.


Does this work?

Yes that works! Thank you so much!