MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / shuffle_sentence

Function shuffle_sentence

join/Deepjoin/dataprocess/multi_preocess_csv.py:21–31  ·  view source on GitHub ↗
(sentence)

Source from the content-addressed store, hash-verified

19
20
21def shuffle_sentence(sentence):
22 # 将句子拆分为单词列表
23 words = sentence.split()
24
25 # 打乱单词列表
26 random.shuffle(words)
27
28 # 重新组合打乱后的单词列表为句子
29 shuffled_sentence = ' '.join(words)
30
31 return shuffled_sentence
32
33def split_dataframe(df, num_parts):
34 # 计算每份的行数

Callers 1

process_task4Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected