This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Detokenizes the raw ECMT Korean coref data and uploads to Hugging Face.""" | |
from kiwipiepy import Kiwi | |
kiwi = Kiwi() | |
def detokenize(tokens): | |
token_tuples = [(tok["text"], tok["xpos"]) for tok in tokens] | |
return kiwi.join(token_tuples, return_positions=True, lm_search=True) |