查看: 34|回复: 0

一个数据清洗去重的脚本

[复制链接]

7352

积分

545

帖子

1万

符石

太乙金仙

Rank: 10Rank: 10

积分
7352

灌水之王论坛元老咸鱼勋章

发表于 昨天 19:09 | 显示全部楼层 |阅读模式
在做Qwen3指令监督微调时,其中一份生成式数据集存在大量重复文字、词语、短语、句式
于是让AI写了个去重脚本:
重复内容有多种表现形式:
  • 字符级重复:啊啊啊啊、数据数据数据
  • 词语级重复:重要重要重要、测试测试测试
  • 短句级重复:这是一个测试。这是一个测试。这是一个测试。
  • 句式级重复:重要的是...、首先...、步骤一...

单一层次的检测无法覆盖所有情况,需要综合多种检测方法。

参数:
- min_length: n-gram最小长度
- max_length: n-gram最大长度
- min_repeats: n-gram最少重复次数
- min_ratio: 重复n-gram占总内容比例阈值

脚本如下:
  1. import json
  2. import re
  3. from collections import Counter
  4. import time
  5. import sys

  6. def has_high_char_repetition(text, min_repeats=4, max_ratio=0.1):
  7.     """
  8.     检测连续单字重复(如"啊啊啊")
  9.     """
  10.     if not text:
  11.         return False
  12.    
  13.     # 提取所有中文字符
  14.     chinese_chars = re.findall(r'[\u4e00-\u9fff]', text)
  15.     if not chinese_chars:
  16.         return False
  17.    
  18.     total_chars = len(chinese_chars)
  19.    
  20.     # 检测连续重复字符
  21.     repeat_count = 0
  22.     i = 0
  23.     while i < len(chinese_chars) - min_repeats + 1:
  24.         current_char = chinese_chars[i]
  25.         repeat_len = 1
  26.         
  27.         # 检查连续重复
  28.         while i + repeat_len < len(chinese_chars) and chinese_chars[i + repeat_len] == current_char:
  29.             repeat_len += 1
  30.         
  31.         # 如果重复达到阈值
  32.         if repeat_len >= min_repeats:
  33.             repeat_count += repeat_len
  34.             i += repeat_len
  35.         else:
  36.             i += 1
  37.    
  38.     return repeat_count / total_chars >= max_ratio

  39. def has_high_symbol_letter_repetition(text, min_repeats=8, max_ratio=0.05):
  40.     """
  41.     检测符号和字母的重复(大小写敏感)
  42.    
  43.     优化点:
  44.     - 专门处理字母(大小写)和符号重复
  45.     - 提高重复阈值避免误伤正常内容
  46.     - 分别检测连续重复和周期性重复
  47.    
  48.     参数:
  49.     - min_repeats: 最小重复次数(提高到8避免误伤)
  50.     - max_ratio: 重复内容占比阈值(降低到5%)
  51.    
  52.     返回:
  53.     - bool: 是否存在高重复符号/字母
  54.     """
  55.     if not text:
  56.         return False
  57.    
  58.     # 提取所有非中文字符(字母、数字、符号)
  59.     non_chinese = re.findall(r'[^\u4e00-\u9fff]', text)
  60.     if not non_chinese or len(non_chinese) < min_repeats * 2:
  61.         return False
  62.    
  63.     total_non_chinese = len(non_chinese)
  64.    
  65.     # 检测1: 连续相同字符重复 (如 "aaaaaaaa")
  66.     consecutive_repeats = 0
  67.     i = 0
  68.     while i < len(non_chinese) - min_repeats + 1:
  69.         current_char = non_chinese[i]
  70.         repeat_len = 1
  71.         
  72.         while i + repeat_len < len(non_chinese) and non_chinese[i + repeat_len] == current_char:
  73.             repeat_len += 1
  74.         
  75.         if repeat_len >= min_repeats:
  76.             consecutive_repeats += repeat_len
  77.             i += repeat_len
  78.         else:
  79.             i += 1
  80.    
  81.     if consecutive_repeats / total_non_chinese >= max_ratio:
  82.         return True
  83.    
  84.     # 检测2: 周期性重复 (如 "abababab")
  85.     # 只检查长度为2-5的周期模式
  86.     for pattern_len in [2, 3, 4, 5]:
  87.         if total_non_chinese < pattern_len * min_repeats:
  88.             continue
  89.             
  90.         i = 0
  91.         periodic_repeats = 0
  92.         
  93.         while i <= len(non_chinese) - pattern_len * min_repeats:
  94.             pattern = non_chinese[i:i+pattern_len]
  95.             repeat_len = 1
  96.             
  97.             # 检查周期性重复
  98.             while (i + pattern_len * (repeat_len + 1) <= len(non_chinese) and
  99.                    non_chinese[i + pattern_len * repeat_len:i + pattern_len * (repeat_len + 1)] == pattern):
  100.                 repeat_len += 1
  101.             
  102.             # 如果周期重复达到阈值
  103.             if repeat_len >= min_repeats:
  104.                 # 计算重复字符数(排除第一次出现)
  105.                 periodic_repeats += pattern_len * (repeat_len - 1)
  106.                 i += pattern_len * repeat_len
  107.             else:
  108.                 i += 1
  109.         
  110.         if periodic_repeats / total_non_chinese >= max_ratio:
  111.             return True
  112.    
  113.     return False

  114. def has_high_word_repetition(text, min_word_length=2, max_word_length=10,
  115.                             min_repeats=2, max_ratio=0.08):
  116.     """
  117.     检测连续词语重复(优化版)
  118.     """
  119.     if not text:
  120.         return False
  121.    
  122.     # 提取所有中文字符序列
  123.     chinese_text = ''.join(re.findall(r'[\u4e00-\u9fff]', text))
  124.     if len(chinese_text) < min_word_length * min_repeats:
  125.         return False
  126.    
  127.     total_length = len(chinese_text)
  128.     if total_length == 0:
  129.         return False
  130.    
  131.     # 优化:只检查特定长度的词语(2, 4, 6, 8, 10字)
  132.     word_lengths = [2, 4, 6, 8, 10]
  133.     max_repeat_ratio = 0
  134.    
  135.     for word_len in word_lengths:
  136.         if word_len > max_word_length or word_len > total_length // min_repeats:
  137.             continue
  138.             
  139.         i = 0
  140.         repeat_chars = 0
  141.         
  142.         while i <= len(chinese_text) - word_len * min_repeats:
  143.             word = chinese_text[i:i+word_len]
  144.             repeat_len = 1
  145.             
  146.             # 检查连续重复
  147.             while (i + word_len * (repeat_len + 1) <= len(chinese_text) and
  148.                    chinese_text[i + word_len * repeat_len:i + word_len * (repeat_len + 1)] == word):
  149.                 repeat_len += 1
  150.             
  151.             # 如果重复达到阈值
  152.             if repeat_len >= min_repeats:
  153.                 repeat_chars += word_len * (repeat_len - 1)
  154.                 i += word_len * repeat_len
  155.             else:
  156.                 i += 1
  157.         
  158.         # 计算该长度词语的重复比例
  159.         if repeat_chars > 0:
  160.             repeat_ratio = repeat_chars / total_length
  161.             max_repeat_ratio = max(max_repeat_ratio, repeat_ratio)
  162.    
  163.     return max_repeat_ratio >= max_ratio

  164. def has_high_short_sentence_repetition(text, min_length=5, min_repeats=5, min_ratio=0.1):
  165.     """
  166.     检测短句重复(优化版)
  167.     """
  168.     if not text or len(text) < min_length * min_repeats:
  169.         return False
  170.    
  171.     # 分割句子(使用中文标点)
  172.     sentences = re.split(r'[。!?;…\n]', text)
  173.     # 过滤无效句子
  174.     sentences = [s.strip() for s in sentences if len(s.strip()) >= min_length]
  175.    
  176.     if len(sentences) < min_repeats:
  177.         return False
  178.    
  179.     # 特别优化:检测极高密度重复
  180.     sentence_counts = Counter(sentences)
  181.     for sentence, count in sentence_counts.most_common(1):
  182.         if count >= 8:  # 只需重复8次就标记
  183.             return True
  184.    
  185.     # 计算重复情况
  186.     total_length = sum(len(s) for s in sentences)
  187.     repeated_length = 0
  188.    
  189.     for sentence, count in sentence_counts.items():
  190.         if count >= min_repeats:
  191.             repeated_length += len(sentence) * (count - 1)
  192.    
  193.     return repeated_length / total_length >= min_ratio

  194. def has_high_sentence_pattern_repetition(text,
  195.                                         min_repeated_patterns=4,  # 提高到4避免误伤
  196.                                         pattern_threshold=0.3,    # 提高到30%避免误伤
  197.                                         pattern_length=4,
  198.                                         max_common_patterns=1):
  199.     """
  200.     检测句式重复(优化版 - 降低敏感度)
  201.    
  202.     关键调整:
  203.     - min_repeated_patterns 从2提高到4
  204.     - pattern_threshold 从15%提高到30%
  205.     - 避免将正常叙述误判为重复
  206.     """
  207.     if not text or len(text) < 50:
  208.         return False
  209.         
  210.     # 分割句子
  211.     sentences = re.split(r'[。!?;…\n]', text)
  212.     # 过滤无效句子
  213.     sentences = [
  214.         s.strip()
  215.         for s in sentences
  216.         if len(s.strip()) > 8 and
  217.            not re.match(r'^[\d#*●\-]\.?[\s\*]*', s) and
  218.            len(s.strip()) < 100  # 排除超长句子(可能是代码)
  219.     ]
  220.    
  221.     if len(sentences) < 8:  # 需要至少8个句子才检测(避免短文本误判)
  222.         return False
  223.    
  224.     # 提取句子开头模式(跳过常见开头)
  225.     patterns = []
  226.     common_starts = {"首先", "其次", "然后", "最后", "另外", "不过", "但是", "因此", "所以",
  227.                     "例如", "比如", "关于", "对于", "通过", "基于", "根据", "由于"}
  228.    
  229.     for s in sentences:
  230.         clean_s = re.sub(r'^[^\u4e00-\u9fff]*', '', s)
  231.         if len(clean_s) >= pattern_length:
  232.             pattern = clean_s[:pattern_length]
  233.             # 跳过常见开头
  234.             if pattern not in common_starts:
  235.                 patterns.append(pattern)
  236.    
  237.     if not patterns or len(patterns) < 5:
  238.         return False
  239.         
  240.     # 统计高频句式
  241.     pattern_counts = Counter(patterns)
  242.     total = len(patterns)
  243.    
  244.     # 检查是否存在高频重复句式
  245.     for pattern, count in pattern_counts.most_common(1):
  246.         # 需要同时满足:
  247.         # 1. 重复次数 >= 4
  248.         # 2. 占比 >= 30%
  249.         # 3. 不是常见短语
  250.         if count >= min_repeated_patterns and count / total >= pattern_threshold:
  251.             return True
  252.    
  253.     return False

  254. def has_high_ngram_repetition(text, min_length=6, max_length=15, min_repeats=3, min_ratio=0.08):
  255.     """
  256.     高性能n-gram重复检测
  257.     """
  258.     if not text or len(text) < min_length * min_repeats:
  259.         return False
  260.    
  261.     # 提取中文文本
  262.     chinese_text = ''.join(re.findall(r'[\u4e00-\u9fff]', text))
  263.     if len(chinese_text) < min_length * min_repeats:
  264.         return False
  265.    
  266.     total_length = len(chinese_text)
  267.     if total_length < 20:
  268.         return False
  269.    
  270.     # 优化:对长文本进行采样
  271.     sample_points = []
  272.     if total_length <= 500:
  273.         sample_points = [(0, total_length)]
  274.     else:
  275.         sample_size = min(300, total_length // 2)
  276.         sample_points = [
  277.             (0, sample_size),
  278.             (total_length // 2, sample_size),
  279.             (total_length - sample_size, sample_size)
  280.         ]
  281.    
  282.     # 只检查特定长度的n-gram
  283.     ngram_lengths = [6, 9, 12, 15]
  284.    
  285.     for start, size in sample_points:
  286.         end = min(start + size, total_length)
  287.         if end <= start:
  288.             continue
  289.             
  290.         sample_text = chinese_text[start:end]
  291.         
  292.         for n in ngram_lengths:
  293.             if n > len(sample_text) // min_repeats:
  294.                 continue
  295.                
  296.             ngram_counts = {}
  297.             max_count = 0
  298.             
  299.             for i in range(len(sample_text) - n + 1):
  300.                 ngram = sample_text[i:i+n]
  301.                 ngram_counts[ngram] = ngram_counts.get(ngram, 0) + 1
  302.                 if ngram_counts[ngram] > max_count:
  303.                     max_count = ngram_counts[ngram]
  304.                     
  305.                     # 早期退出:重复8次以上直接标记
  306.                     if max_count >= 8:
  307.                         return True
  308.             
  309.             # 检查是否有高重复n-gram
  310.             for count in ngram_counts.values():
  311.                 if count >= min_repeats:
  312.                     repeat_ratio = n * (count - 1) / total_length
  313.                     if repeat_ratio >= min_ratio:
  314.                         return True
  315.    
  316.     return False

  317. def is_highly_repetitive(text,
  318.                         char_params=(4, 0.1),
  319.                         symbol_letter_params=(8, 0.05),  # 专门针对符号/字母
  320.                         word_params=(2, 10, 2, 0.08),
  321.                         short_sentence_params=(5, 5, 0.1),
  322.                         pattern_params=(4, 0.3, 4, 1),   # 降低句式敏感度
  323.                         ngram_params=(6, 15, 3, 0.08)):
  324.     """
  325.     综合检测文本是否高度重复
  326.    
  327.     优化点:
  328.     1. 添加专门的符号/字母重复检测
  329.     2. 降低句式重复检测敏感度
  330.     3. 优化检测顺序
  331.     """
  332.     # 1. 检查符号/字母重复(针对您的新问题)
  333.     if has_high_symbol_letter_repetition(text, *symbol_letter_params):
  334.         return True, "符号/字母重复"
  335.    
  336.     # 2. 快速检查:极高密度短句重复
  337.     if has_high_short_sentence_repetition(text, *short_sentence_params):
  338.         return True, "短句重复"
  339.    
  340.     # 3. 检查连续字符重复
  341.     if has_high_char_repetition(text, *char_params):
  342.         return True, "连续字符重复"
  343.    
  344.     # 4. 检查连续词语重复
  345.     if has_high_word_repetition(text, *word_params):
  346.         return True, "连续词语重复"
  347.    
  348.     # 5. 检查句式重复(降低敏感度后)
  349.     if has_high_sentence_pattern_repetition(text, *pattern_params):
  350.         return True, "句式重复"
  351.    
  352.     # 6. 检查n-gram重复
  353.     if has_high_ngram_repetition(text, *ngram_params):
  354.         return True, "n-gram重复"
  355.    
  356.     return False, "无显著重复"

  357. def clean_json_file(input_path, output_path, batch_size=1000):
  358.     """
  359.     高性能清理JSON文件
  360.     """
  361.     # 检测文件格式
  362.     with open(input_path, 'r', encoding='utf-8') as f:
  363.         first_char = f.read(1)
  364.         f.seek(0)
  365.         is_json_lines = (first_char != '[')
  366.    
  367.     # 读取数据
  368.     data = []
  369.     with open(input_path, 'r', encoding='utf-8') as f:
  370.         if is_json_lines:
  371.             for line in f:
  372.                 line = line.strip()
  373.                 if line:
  374.                     try:
  375.                         data.append(json.loads(line))
  376.                     except json.JSONDecodeError:
  377.                         continue
  378.         else:
  379.             data = json.load(f)
  380.    
  381.     # 处理数据
  382.     original_count = len(data)
  383.     cleaned_data = []
  384.     removed_items = []
  385.     removal_reasons = Counter()
  386.     start_time = time.time()
  387.    
  388.     print(f"开始处理 {original_count} 条数据...")
  389.    
  390.     # 处理每个条目
  391.     for i, item in enumerate(data):
  392.         # 显示进度
  393.         if i % batch_size == 0 and i > 0:
  394.             elapsed = time.time() - start_time
  395.             items_per_sec = i / elapsed
  396.             remaining = (original_count - i) / items_per_sec
  397.             print(f"  处理进度: {i}/{original_count} ({i/original_count:.1%}), "
  398.                   f"预计剩余时间: {remaining:.1f}秒")
  399.         
  400.         # 合并所有文本字段
  401.         text_fields = [
  402.             item.get('instruction', ''),
  403.             item.get('input', ''),
  404.             item.get('output', '')
  405.         ]
  406.         full_text = "\n".join(text_fields)
  407.         
  408.         is_repetitive, reason = is_highly_repetitive(full_text)
  409.         if not is_repetitive:
  410.             cleaned_data.append(item)
  411.         else:
  412.             removed_items.append(item)
  413.             removal_reasons[reason] += 1
  414.    
  415.     # 保存结果
  416.     with open(output_path, 'w', encoding='utf-8') as f:
  417.         if is_json_lines:
  418.             # 修复了这里:将 cleaned_ 改为 cleaned_data
  419.             for item in cleaned_data:
  420.                 f.write(json.dumps(item, ensure_ascii=False) + '\n')
  421.         else:
  422.             json.dump(cleaned_data, f, ensure_ascii=False, indent=2)
  423.    
  424.     # 保存移除的条目
  425.     if removed_items:
  426.         removed_path = output_path.replace('.json', '_removed.json')
  427.         with open(removed_path, 'w', encoding='utf-8') as f:
  428.             if is_json_lines:
  429.                 for item in removed_items:
  430.                     f.write(json.dumps(item, ensure_ascii=False) + '\n')
  431.             else:
  432.                 json.dump(removed_items, f, ensure_ascii=False, indent=2)
  433.    
  434.     # 打印统计信息
  435.     total_time = time.time() - start_time
  436.     print(f"\n清理完成!原始条目: {original_count}")
  437.     print(f"保留条目: {len(cleaned_data)} ({len(cleaned_data)/original_count:.1%})")
  438.     print(f"移除条目: {len(removed_items)} ({len(removed_items)/original_count:.1%})")
  439.     print(f"处理速度: {original_count/total_time:.1f} 条/秒")
  440.    
  441.     if removed_items:
  442.         print("\n移除原因统计:")
  443.         for reason, count in removal_reasons.most_common():
  444.             print(f"  - {reason}: {count} 条 ({count/len(removed_items):.1%})")
  445.         
  446.         # 显示一个示例
  447.         print("\n重复内容示例分析:")
  448.         sample = removed_items[0]
  449.         text_fields = [
  450.             sample.get('instruction', ''),
  451.             sample.get('input', ''),
  452.             sample.get('output', '')
  453.         ]
  454.         full_text = "\n".join(text_fields)
  455.         
  456.         is_repetitive, reason = is_highly_repetitive(full_text)
  457.         print(f"检测到: {reason}")
  458.         
  459.         # 根据重复类型显示具体重复内容
  460.         if reason == "符号/字母重复":
  461.             # 检测连续重复
  462.             consecutive = re.search(r'([^\u4e00-\u9fff])\1{7,}', full_text)
  463.             if consecutive:
  464.                 char = consecutive.group(1)
  465.                 print(f"  检测到连续符号/字母重复: '{char * 8}'")
  466.             
  467.             # 检测周期性重复
  468.             if not consecutive:
  469.                 for pattern_len in [2, 3, 4]:
  470.                     pattern = r'([^\u4e00-\u9fff]{' + str(pattern_len) + r'})\1{3,}'
  471.                     periodic = re.search(pattern, full_text)
  472.                     if periodic:
  473.                         print(f"  检测到周期性重复: '{periodic.group(1) * 4}'")
  474.                         break
  475.         
  476.         elif reason == "连续字符重复":
  477.             repeats = re.findall(r'([\u4e00-\u9fff])\1{3,}', full_text)
  478.             if repeats:
  479.                 print(f"  检测到字符重复: '{repeats[0] * 4}'")
  480.         
  481.         elif reason == "连续词语重复":
  482.             for word_len in range(2, 11):
  483.                 pattern = r'([\u4e00-\u9fff]{' + str(word_len) + r'})\1{1,}'
  484.                 matches = re.findall(pattern, full_text)
  485.                 if matches:
  486.                     print(f"  检测到词语重复: '{matches[0] * 2}'")
  487.                     break
  488.         
  489.         elif reason in ["短句重复", "n-gram重复"]:
  490.             chinese_text = ''.join(re.findall(r'[\u4e00-\u9fff]', full_text))
  491.             if len(chinese_text) > 20:
  492.                 sample_text = chinese_text[:min(200, len(chinese_text))]
  493.                 best_ngram = ""
  494.                 best_count = 0
  495.                
  496.                 for n in range(5, 16):
  497.                     ngrams = [sample_text[i:i+n] for i in range(len(sample_text) - n + 1)]
  498.                     if ngrams:
  499.                         counter = Counter(ngrams)
  500.                         most_common, count = counter.most_common(1)[0]
  501.                         if count > best_count:
  502.                             best_count = count
  503.                             best_ngram = most_common
  504.                
  505.                 if best_count >= 3:
  506.                     print(f"  检测到高频重复片段: '{best_ngram}' 重复 {best_count} 次")
  507.         
  508.         elif reason == "句式重复":
  509.             sentences = re.split(r'[。!?;…\n]', full_text)
  510.             sentences = [s.strip() for s in sentences if len(s.strip()) > 8]
  511.             patterns = []
  512.             for s in sentences:
  513.                 clean_s = re.sub(r'^[^\u4e00-\u9fff]*', '', s)
  514.                 if len(clean_s) >= 4:
  515.                     patterns.append(clean_s[:4])
  516.             pattern_counts = Counter(patterns)
  517.             for pattern, count in pattern_counts.most_common(1):
  518.                 if count >= 4:  # 与检测阈值一致
  519.                     print(f"  检测到句式重复: '{pattern}...' 重复 {count} 次")
  520.    
  521.     return len(removed_items)

  522. if __name__ == "__main__":
  523.     # 针对您的数据特点优化的参数
  524.     CHAR_PARAMS = (4, 0.1)
  525.     SYMBOL_LETTER_PARAMS = (8, 0.05)  # 专门针对符号/字母重复
  526.     WORD_PARAMS = (2, 10, 2, 0.08)
  527.     SHORT_SENTENCE_PARAMS = (5, 5, 0.1)
  528.     PATTERN_PARAMS = (4, 0.3, 4, 1)   # 降低句式检测敏感度
  529.     NGRAM_PARAMS = (6, 15, 3, 0.08)
  530.    
  531.     print("启动高性能重复内容检测工具...")
  532.     start_time = time.time()
  533.    
  534.     removed_count = clean_json_file(
  535.         input_path='toxic-sft-zh-plus.json',
  536.         output_path='toxic-sft-zh-plus-new.json'
  537.     )
  538.    
  539.     total_time = time.time() - start_time
  540.     print(f"\n处理完成!总耗时: {total_time:.2f}秒")
复制代码

效果如下:
  1. (venv) D:\AI\data_tools>python quchong.py
  2. 启动高性能重复内容检测工具...
  3. 开始处理 56481 条数据...
  4.   处理进度: 1000/56481 (1.8%), 预计剩余时间: 28.2秒
  5.   处理进度: 2000/56481 (3.5%), 预计剩余时间: 30.5秒
  6.   处理进度: 3000/56481 (5.3%), 预计剩余时间: 30.2秒
  7.   处理进度: 4000/56481 (7.1%), 预计剩余时间: 30.2秒
  8.   处理进度: 5000/56481 (8.9%), 预计剩余时间: 30.2秒
  9.   处理进度: 6000/56481 (10.6%), 预计剩余时间: 29.4秒
  10.   处理进度: 7000/56481 (12.4%), 预计剩余时间: 28.7秒
  11.   处理进度: 8000/56481 (14.2%), 预计剩余时间: 28.1秒
  12.   处理进度: 9000/56481 (15.9%), 预计剩余时间: 27.6秒
  13.   处理进度: 10000/56481 (17.7%), 预计剩余时间: 27.0秒
  14.   处理进度: 11000/56481 (19.5%), 预计剩余时间: 26.4秒
  15.   处理进度: 12000/56481 (21.2%), 预计剩余时间: 25.8秒
  16.   处理进度: 13000/56481 (23.0%), 预计剩余时间: 25.1秒
  17.   处理进度: 14000/56481 (24.8%), 预计剩余时间: 24.5秒
  18.   处理进度: 15000/56481 (26.6%), 预计剩余时间: 23.9秒
  19.   处理进度: 16000/56481 (28.3%), 预计剩余时间: 23.3秒
  20.   处理进度: 17000/56481 (30.1%), 预计剩余时间: 22.8秒
  21.   处理进度: 18000/56481 (31.9%), 预计剩余时间: 22.2秒
  22.   处理进度: 19000/56481 (33.6%), 预计剩余时间: 21.6秒
  23.   处理进度: 20000/56481 (35.4%), 预计剩余时间: 21.0秒
  24.   处理进度: 21000/56481 (37.2%), 预计剩余时间: 20.4秒
  25.   处理进度: 22000/56481 (39.0%), 预计剩余时间: 19.9秒
  26.   处理进度: 23000/56481 (40.7%), 预计剩余时间: 19.3秒
  27.   处理进度: 24000/56481 (42.5%), 预计剩余时间: 18.8秒
  28.   处理进度: 25000/56481 (44.3%), 预计剩余时间: 18.2秒
  29.   处理进度: 26000/56481 (46.0%), 预计剩余时间: 17.6秒
  30.   处理进度: 27000/56481 (47.8%), 预计剩余时间: 17.1秒
  31.   处理进度: 28000/56481 (49.6%), 预计剩余时间: 16.5秒
  32.   处理进度: 29000/56481 (51.3%), 预计剩余时间: 16.0秒
  33.   处理进度: 30000/56481 (53.1%), 预计剩余时间: 15.4秒
  34.   处理进度: 31000/56481 (54.9%), 预计剩余时间: 14.8秒
  35.   处理进度: 32000/56481 (56.7%), 预计剩余时间: 14.2秒
  36.   处理进度: 33000/56481 (58.4%), 预计剩余时间: 13.7秒
  37.   处理进度: 34000/56481 (60.2%), 预计剩余时间: 13.1秒
  38.   处理进度: 35000/56481 (62.0%), 预计剩余时间: 12.5秒
  39.   处理进度: 36000/56481 (63.7%), 预计剩余时间: 11.9秒
  40.   处理进度: 37000/56481 (65.5%), 预计剩余时间: 11.3秒
  41.   处理进度: 38000/56481 (67.3%), 预计剩余时间: 10.8秒
  42.   处理进度: 39000/56481 (69.0%), 预计剩余时间: 10.2秒
  43.   处理进度: 40000/56481 (70.8%), 预计剩余时间: 9.6秒
  44.   处理进度: 41000/56481 (72.6%), 预计剩余时间: 9.0秒
  45.   处理进度: 42000/56481 (74.4%), 预计剩余时间: 8.4秒
  46.   处理进度: 43000/56481 (76.1%), 预计剩余时间: 7.8秒
  47.   处理进度: 44000/56481 (77.9%), 预计剩余时间: 7.2秒
  48.   处理进度: 45000/56481 (79.7%), 预计剩余时间: 6.6秒
  49.   处理进度: 46000/56481 (81.4%), 预计剩余时间: 6.0秒
  50.   处理进度: 47000/56481 (83.2%), 预计剩余时间: 5.4秒
  51.   处理进度: 48000/56481 (85.0%), 预计剩余时间: 4.9秒
  52.   处理进度: 49000/56481 (86.8%), 预计剩余时间: 4.3秒
  53.   处理进度: 50000/56481 (88.5%), 预计剩余时间: 3.7秒
  54.   处理进度: 51000/56481 (90.3%), 预计剩余时间: 3.1秒
  55.   处理进度: 52000/56481 (92.1%), 预计剩余时间: 2.5秒
  56.   处理进度: 53000/56481 (93.8%), 预计剩余时间: 2.0秒
  57.   处理进度: 54000/56481 (95.6%), 预计剩余时间: 1.4秒
  58.   处理进度: 55000/56481 (97.4%), 预计剩余时间: 0.8秒
  59.   处理进度: 56000/56481 (99.1%), 预计剩余时间: 0.3秒

  60. 清理完成!原始条目: 56481
  61. 保留条目: 31454 (55.7%)
  62. 移除条目: 25027 (44.3%)
  63. 处理速度: 1749.2 条/秒

  64. 移除原因统计:
  65.   - 句式重复: 23969 条 (95.8%)
  66.   - n-gram重复: 540 条 (2.2%)
  67.   - 短句重复: 446 条 (1.8%)
  68.   - 连续词语重复: 65 条 (0.3%)
  69.   - 连续字符重复: 7 条 (0.0%)

  70. 重复内容示例分析:
  71. 检测到: 句式重复
  72.   检测到句式重复: '萨德-马...' 重复 5 次

  73. 处理完成!总耗时: 32.58秒
复制代码
通用直播丹代练:QQ1453174

小黑屋|ZhaTV ( 滇ICP备15003127号-4 ) |网站地图

GMT+8, 2025-9-19 07:25

Powered by Zhatv.cn

© 2022-2023

快速回复 返回顶部 返回列表