(sentence)
| 19 | |
| 20 | |
| 21 | def 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 | |
| 33 | def split_dataframe(df, num_parts): |
| 34 | # 计算每份的行数 |