AnAutomaticPencil's picture
data preprocessing update
a6326c7
raw
history blame
655 Bytes
from const import UTTERANCE, CHARACTERS, START, END, MENTION
def introduce_mention_to_utterance(turn, insert_index, left_bracket, right_bracket):
turn[UTTERANCE] = (
turn[UTTERANCE][:insert_index]
+ left_bracket
+ MENTION
+ right_bracket
+ turn[UTTERANCE][insert_index:]
)
return turn
def introduce_mention_to_utterance_wrapper(left_bracket, right_bracket):
def introduce_mention_to_utterance_func(turn, insert_index, **kwargs):
return introduce_mention_to_utterance(
turn, insert_index, left_bracket, right_bracket
)
return introduce_mention_to_utterance_func