MCPcopy Create free account
hub / github.com/RingBDStack/GDAP / get_str_from_tokens

Function get_str_from_tokens

data_convert/format/text2target.py:10–12  ·  view source on GitHub ↗
(tokens, sentence, separator=' ')

Source from the content-addressed store, hash-verified

8
9# 通过span获取到具体的文本内容(start, end位置)
10def get_str_from_tokens(tokens, sentence, separator=' '):
11 start, end_exclude = tokens[0], tokens[-1] + 1
12 return separator.join(sentence[start:end_exclude])
13
14# T5 tokenizer使用的特殊符号
15type_start = '<extra_id_0>'

Callers 2

annotate_spanMethod · 0.85
annotate_spanMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected