Token Classification
Transformers
ONNX
Safetensors
English
Japanese
Chinese
bert
anime
filename-parsing
Eval Results (legacy)
Run this model with HF Jobs
Run ModerRAS/AniFileBERT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/ModerRAS/AniFileBERT. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ModerRAS/AniFileBERT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use ModerRAS/AniFileBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ModerRAS/AniFileBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="ModerRAS/AniFileBERT")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("ModerRAS/AniFileBERT") model = AutoModelForTokenClassification.from_pretrained("ModerRAS/AniFileBERT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Clean special code parsing
Browse filesFiles changed (14)
- build_repair_focus_dataset.py+65
- case_metrics.json+100-14
- data/parser_regression_cases.json+47
- datasets/AnimeName+1-1
- dmhy_dataset.py+273-6
- exports/anime_filename_parser.metadata.json+1-1
- exports/anime_filename_parser.onnx+2-2
- inference.py+156-17
- label_repairs.py+5-1
- model.safetensors+1-1
- parse_eval_metrics.json+345-326
- run_metadata.json+12-12
- trainer_eval_metrics.json+9-9
- training_args.bin+1-1
4 unmodified lines56789101112131415161718192021223 unmodified lines2627282930313233343599 unmodified lines1351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801813 unmodified lines18518618718818919019111 unmodified lines2032042052062072082092102112122132142152162176 unmodified lines2242252262272282292302319 unmodified lines2412422432442452462474 unmodified linesimport argparseimport jsonimport randomimport refrom pathlib import Pathfrom typing import Iterable, List
from label_repairs import repair_jsonl_item
SPECIAL_FOCUS_RE = re.compile( r"(?<![A-Za-z0-9])(?:NCOP|NCED|OP|ED|PV|CM|IV)\s*[_\-.]?\s*\d{0,4}" r"(?:[_\-.]?\s*(?:EP?|#)?\d{1,4})?(?![A-Za-z0-9])", re.I,)
def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser(description="Build repair-focused char JSONL fine-tune data")3 unmodified lines help="Random non-repaired rows to include for stability") parser.add_argument("--repeat-repaired", type=int, default=4, help="Repeat rows that still trigger a repair pass") parser.add_argument("--repeat-focus", type=int, default=3, help="Repeat rows matching special-code focus patterns") parser.add_argument("--max-focus-rows", type=int, default=80000, help="Maximum dataset rows matching special-code focus patterns") parser.add_argument("--repeat-manual", type=int, default=24, help="Repeat hand-labeled hard cases") parser.add_argument("--seed", type=int, default=42)99 unmodified lines ("4K", "RESOLUTION"), ], ) yield char_item( "[YYDM&VCB-Studio] Shinsekai Yori [IV05][Ma10p_1080p][x265_aac].mkv", [ ("YYDM&VCB-Studio", "GROUP"), ("Shinsekai Yori", "TITLE"), ("IV05", "SPECIAL"), ("1080p", "RESOLUTION"), ("x265_aac", "SOURCE"), ], ) yield char_item( "[YYDM&VCB-Studio] Shinsekai Yori [NCED02][Ma10p_1080p][x265_flac].mkv", [ ("YYDM&VCB-Studio", "GROUP"), ("Shinsekai Yori", "TITLE"), ("NCED02", "SPECIAL"), ("1080p", "RESOLUTION"), ("x265_flac", "SOURCE"), ], ) yield char_item( "InuYasha.2000.NCED02.BDrip.AV1.10Bit.DTS.1080p-CalChi", [ ("InuYasha", "TITLE"), ("NCED02", "SPECIAL"), ("BDrip", "SOURCE"), ("AV1", "SOURCE"), ("DTS", "SOURCE"), ("1080p", "RESOLUTION"), ], ) yield char_item( "[VCB-Studio] Yamada-kun to 7-nin no Majo [NCED][Ma10p_1080p][x265_flac]", [ ("VCB-Studio", "GROUP"), ("Yamada-kun to 7-nin no Majo", "TITLE"), ("NCED", "SPECIAL"), ("1080p", "RESOLUTION"), ("x265_flac", "SOURCE"), ], )
def main() -> None:3 unmodified lines output_path = Path(args.output)
repaired_rows: List[dict] = [] focus_rows: List[dict] = [] reservoir: List[dict] = [] seen_filenames = set() total_rows = 011 unmodified lines if filename: seen_filenames.add(filename) continue if filename and SPECIAL_FOCUS_RE.search(filename): if len(focus_rows) < args.max_focus_rows: focus_rows.append(item) seen_filenames.add(filename) else: index = rng.randrange(total_rows) if index < args.max_focus_rows: focus_rows[index] = item continue if filename in seen_filenames: continue if len(reservoir) < args.context_samples:6 unmodified lines rows: List[dict] = [] for item in repaired_rows: rows.extend([item] * max(1, args.repeat_repaired)) for item in focus_rows: rows.extend([item] * max(1, args.repeat_focus)) rows.extend(reservoir) for item in manual_cases(): rows.extend([item] * max(1, args.repeat_manual))9 unmodified lines "output": str(output_path), "total_rows": total_rows, "repaired_rows": len(repaired_rows), "focus_rows": len(focus_rows), "context_rows": len(reservoir), "manual_rows": len(list(manual_cases())), "written_rows": len(rows),4 unmodified lines5678989101112131415161213141516171818192021222324252122232425262727282930445 unmodified lines4764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665674 unmodified lines "max_length": 128, "use_rules": true, "constrain_bio": true, "case_count": 22, "full_correct": 22, "case_count": 26, "full_correct": 26, "full_accuracy": 1.0, "field_correct": { "group": 19, "title": 22, "episode": 22, "resolution": 22, "source": 15, "group": 22, "title": 26, "episode": 26, "resolution": 26, "source": 19, "season": 9, "special": 1 "special": 5 }, "field_total": { "group": 19, "title": 22, "episode": 22, "resolution": 22, "source": 15, "group": 22, "title": 26, "episode": 26, "resolution": 26, "source": 19, "season": 9, "special": 1 "special": 5 }, "field_accuracy": { "episode": 1.0,445 unmodified lines "source": "GB", "title": "逆天邪神" } }, { "id": "vcb_special_iv_not_episode", "filename": "[YYDM&VCB-Studio] Shinsekai Yori [IV05][Ma10p_1080p][x265_aac].mkv", "ok": true, "errors": {}, "expected": { "group": "YYDM&VCB-Studio", "title": "Shinsekai Yori", "episode": null, "resolution": "1080p", "source": "x265_aac", "special": "IV05" }, "pred": { "episode": null, "group": "YYDM&VCB-Studio", "resolution": "1080p", "source": "x265_aac", "special": "IV05", "title": "Shinsekai Yori" } }, { "id": "vcb_nced_not_episode", "filename": "[YYDM&VCB-Studio] Shinsekai Yori [NCED02][Ma10p_1080p][x265_flac].mkv", "ok": true, "errors": {}, "expected": { "group": "YYDM&VCB-Studio", "title": "Shinsekai Yori", "episode": null, "resolution": "1080p", "source": "x265_flac", "special": "NCED02" }, "pred": { "episode": null, "group": "YYDM&VCB-Studio", "resolution": "1080p", "source": "x265_flac", "special": "NCED02", "title": "Shinsekai Yori" } }, { "id": "dot_nced_suffix_not_episode", "filename": "InuYasha.2000.NCED02.BDrip.AV1.10Bit.DTS.1080p-CalChi", "ok": true, "errors": {}, "expected": { "title": "InuYasha", "episode": null, "resolution": "1080p", "source": "BDrip", "special": "NCED02" }, "pred": { "episode": null, "resolution": "1080p", "source": "BDrip", "special": "NCED02", "title": "InuYasha" } }, { "id": "vcb_numeric_title_nced", "filename": "[VCB-Studio] Yamada-kun to 7-nin no Majo [NCED][Ma10p_1080p][x265_flac]", "ok": true, "errors": {}, "expected": { "group": "VCB-Studio", "title": "Yamada-kun to 7-nin no Majo", "episode": null, "resolution": "1080p", "source": "x265_flac", "special": "NCED" }, "pred": { "episode": null, "group": "VCB-Studio", "resolution": "1080p", "source": "x265_flac", "special": "NCED", "title": "Yamada-kun to 7-nin no Majo" } } ]}239 unmodified lines240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291239 unmodified lines "resolution": "4K", "source": "GB" } }, { "id": "vcb_special_iv_not_episode", "filename": "[YYDM&VCB-Studio] Shinsekai Yori [IV05][Ma10p_1080p][x265_aac].mkv", "expected": { "group": "YYDM&VCB-Studio", "title": "Shinsekai Yori", "episode": null, "resolution": "1080p", "source": "x265_aac", "special": "IV05" } }, { "id": "vcb_nced_not_episode", "filename": "[YYDM&VCB-Studio] Shinsekai Yori [NCED02][Ma10p_1080p][x265_flac].mkv", "expected": { "group": "YYDM&VCB-Studio", "title": "Shinsekai Yori", "episode": null, "resolution": "1080p", "source": "x265_flac", "special": "NCED02" } }, { "id": "dot_nced_suffix_not_episode", "filename": "InuYasha.2000.NCED02.BDrip.AV1.10Bit.DTS.1080p-CalChi", "expected": { "title": "InuYasha", "episode": null, "resolution": "1080p", "source": "BDrip", "special": "NCED02" } }, { "id": "vcb_numeric_title_nced", "filename": "[VCB-Studio] Yamada-kun to 7-nin no Majo [NCED][Ma10p_1080p][x265_flac]", "expected": { "group": "VCB-Studio", "title": "Yamada-kun to 7-nin no Majo", "episode": null, "resolution": "1080p", "source": "x265_flac", "special": "NCED" } }]11Subproject commit 004a8c08628b6820fb2d1b59a80fdcfe925ef095Subproject commit c40cb38963a390a61c6d375409031f8a6c5eb92732 unmodified lines333435363738391 unmodified line4142434344454647484950515253545556575825 unmodified lines8485868788899091929394959697989967 unmodified lines16716816917017117217317443 unmodified lines21821922020022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036165 unmodified lines4274284294304314324334344354364374384394 unmodified lines44444544628544744844945045136 unmodified lines48848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054116 unmodified lines55855956056156256356456556656756856957057157257357457557657757857958058158258358432 unmodified lines6176186196206216226236246256266276286296306316 unmodified lines63863964064164264364464523 unmodified lines66967067167267367467514 unmodified lines690691692449693694695696168 unmodified lines86586686762486886987087187287387487587687787887988088163488288388488588688788888989089189289368 unmodified lines96296396496596696796896997097197297397445 unmodified lines102010211022102310241025102610273 unmodified lines103110321033103410351036103710381039104032 unmodified lines "mp4", "mkv", "avi", "webm", "mov", "wmv", "flv", "rmvb", "ts", "m2ts", "raw", "raws", "rip", "10bit", "8bit", "hi10p", "ma10p", "ass", "assx2", "tc", "sc", "gb", "big5", "cht", "chs", "jpn", "jp", "jap", "eng", "sdr", "hdr", "hdr10", "uhd", "remux", "tvb", "srt", "srtx2", "繁中", "简中", "繁日", "简日", "日语", "日文", "外挂", "内封", "字幕",}CATEGORY_BRACKETS = {1 unmodified line "国创", "國創", "中国动漫", "中國動漫", "中国动画", "中國動畫",}
SPECIAL_RE = re.compile(r"^(?:ova\d*|oad\d*|sp\d*|movie|the\s*movie|op|ed|pv|cm|ncop|nced|剧场版|劇場版|特别篇|特別篇)$", re.I)SPECIAL_RE = re.compile( r"^(?:ova\d*|oad\d*|sp\d*|movie|the\s*movie|op\d*|ed\d*|pv\d*|cm\d*|" r"ncop\d*|nced\d*|iv\d+|剧场版|劇場版|特别篇|特別篇)$", re.I,)SPECIAL_INDEX_BASE_RE = re.compile(r"^(?:NCOP|NCED|OP|ED|PV|CM|IV)$", re.I)SPECIAL_INDEX_RE = re.compile(r"^(?:NCOP|NCED|OP|ED|PV|CM)\d*$|^IV\d+$", re.I)SPECIAL_COMPOSITE_RE = re.compile( r"^(?P<special>(?:(?:NCOP|NCED|OP|ED|PV|CM)\d*|IV\d+))" r"(?:(?P<sep>[\s._-]+)(?P<episode>(?:EP?|#)?\d{1,4}))?$", re.I,)SPECIAL_SEARCH_RE = re.compile(r"^(?:檢索|检索|搜索|搜寻|搜尋|别名|別名|alias|search|keyword)\s*[::].+", re.I)EPISODE_RE = re.compile(r"^(?:[Ee][Pp]?|#)?(\d{1,4})(?:v\d+|END)?$", re.I)SEASON_RE = re.compile(25 unmodified lines r"^(?:WEB[-_ ]?DL|WEB[-_ ]?Rip|BDRip|BluRay|BDMV|BD|DVDRip|DVD|TVRip|HDTV|" r"Netflix|NF|AMZN|Baha|CR|ABEMA|DSNP|U[-_ ]?NEXT|Hulu|AT[-_ ]?X|" r"x26[45]|h\.?26[45]|HEVC|AVC|AV1|AAC\d*(?:\.\d+)?|AAC|FLAC|MP3|DTS|Opus|" r"SDR|HDR10?|UHD|REMUX|10bit|8bit|Hi10p|Ma10p|ASSx?\d*|SRTx?\d*|" r"CHS|CHT|BIG5|GB|JPN?|JPSC|JPTC|简[体體]?|繁[体體]?|简日双语|繁日双语|内封|外挂|MSubs?)$", re.I,)MEDIA_META_RE = re.compile( r"(?:WEB[-_ ]?DL|WEB[-_ ]?Rip|BDRip|BluRay|BDMV|BD|DVDRip|DVD|TVRip|HDTV|" r"x26[45]|h\.?26[45]|HEVC|AVC|AV1|AAC\d*(?:\.\d+)?|FLAC|MP3|DTS|Opus|" r"10bit|8bit|Hi10p|Ma10p|YUV\d+P?\d*)", re.I,)GROUP_HINT_RE = re.compile( r"(?:字幕|字幕组|字幕組|sub|subs|raws?|fansub|studio|house|team|project|" r"loli|ani|baha|vcb|airota|kiss|dmhy|mabors|lilith|ohys|erai|subsplease)",67 unmodified lines
def episode_number(token: str) -> Optional[int]: clean = clean_bracket(token) if SPECIAL_INDEX_RE.match(clean): return None if season_number(clean) is not None: return None if DIMENSION_RE.match(clean) or DATE_RE.match(clean) or HASH_RE.match(clean):43 unmodified lines
def is_special(token: str) -> bool: clean = clean_bracket(token) return bool(SPECIAL_RE.match(clean) or SPECIAL_SEARCH_RE.match(clean)) return bool( SPECIAL_RE.match(clean) or SPECIAL_SEARCH_RE.match(clean) or SPECIAL_COMPOSITE_RE.fullmatch(clean) )
def is_special_index_base(token: str) -> bool: return bool(SPECIAL_INDEX_BASE_RE.match(clean_bracket(token)))
def previous_significant_index(tokens: Sequence[str], idx: int) -> Optional[int]: cursor = idx - 1 while cursor >= 0: if not is_separator_token(tokens[cursor]): return cursor cursor -= 1 return None
def next_significant_index(tokens: Sequence[str], idx: int) -> Optional[int]: cursor = idx + 1 while cursor < len(tokens): if not is_separator_token(tokens[cursor]): return cursor cursor += 1 return None
def previous_non_space_index(tokens: Sequence[str], idx: int) -> Optional[int]: cursor = idx - 1 while cursor >= 0: if tokens[cursor].strip(): return cursor cursor -= 1 return None
def is_special_index_continuation(tokens: Sequence[str], idx: int) -> bool: clean = clean_bracket(tokens[idx]) if not re.fullmatch(r"\d{1,4}", clean): return False prev_idx = previous_significant_index(tokens, idx) return prev_idx is not None and is_special_index_base(tokens[prev_idx])
def has_special_index_continuation_after(tokens: Sequence[str], idx: int) -> bool: next_idx = next_significant_index(tokens, idx) return next_idx is not None and is_special_index_continuation(tokens, next_idx)
def is_special_index_sequence_token(tokens: Sequence[str], idx: int) -> bool: return ( is_special_index_continuation(tokens, idx) or (is_special_index_base(tokens[idx]) and has_special_index_continuation_after(tokens, idx)) )
def is_episode_after_special_index(tokens: Sequence[str], idx: int) -> bool: clean = clean_bracket(tokens[idx]) if episode_number(clean) is None: return False prev_idx = previous_significant_index(tokens, idx) if prev_idx is None: return False if is_special_index_continuation(tokens, prev_idx): return True if SPECIAL_INDEX_RE.match(clean_bracket(tokens[prev_idx])): return True return False
def is_numeric_media_fragment(tokens: Sequence[str], idx: int) -> bool: clean = clean_bracket(tokens[idx]) if not re.fullmatch(r"\d{1,4}", clean): return False
prev_idx = idx - 1 if idx > 0 else None next_idx = idx + 1 if idx + 1 < len(tokens) else None prev_clean = clean_bracket(tokens[prev_idx]).lower() if prev_idx is not None else "" next_clean = clean_bracket(tokens[next_idx]).lower() if next_idx is not None else ""
if next_clean in {"bit", "bits"}: return True if prev_clean == "ma" and next_clean == "p": return True if prev_clean in {"aac", "flac", "dts", "ddp", "ac3", "mp"} and next_clean == ".": return True if prev_clean == ".": prev_prev = clean_bracket(tokens[idx - 2]).lower() if idx >= 2 else "" if re.fullmatch(r"\d+", prev_prev): return True return False
def is_special_index_suffix(tokens: Sequence[str], idx: int) -> bool: clean = clean_bracket(tokens[idx]) if not re.fullmatch(r"\d{1,4}", clean): return False prev_idx = previous_significant_index(tokens, idx) if prev_idx is None: return False if is_special_index_base(tokens[prev_idx]): return True prev_clean = clean_bracket(tokens[prev_idx]) return bool(re.fullmatch(r"(?:NCOP|NCED|OP|ED|PV|CM)$", prev_clean, re.I))
def is_structural_episode_candidate(tokens: Sequence[str], idx: int, number: int) -> bool: clean = clean_bracket(tokens[idx]) if re.match(r"^(?:[Ee][Pp]?|#|第|OVA|OAD|SP)", clean, re.I): return True if re.match(r"^\d{1,4}(?:v\d+|END)$", clean, re.I): return True if has_wrapping_brackets(tokens[idx]): return True prev_idx = previous_non_space_index(tokens, idx) if prev_idx is not None and tokens[prev_idx] in {"-", "_", "|"}: return True if idx > 0 and tokens[idx - 1] == "#": return True if number >= 100: return True
next_idx = next_significant_index(tokens, idx) if next_idx is not None and ( is_resolution(tokens[next_idx]) or is_source(tokens[next_idx]) or is_noise_bracket(tokens[next_idx]) ): if prev_idx is None: return False if tokens[prev_idx] in {"-", "_", "|"}: return True if has_wrapping_brackets(tokens[idx]): return True
return False
def is_category_bracket(token: str) -> bool:65 unmodified linesdef find_episode_index(tokens: Sequence[str]) -> Optional[int]: candidates: list[tuple[int, int]] = [] for idx, token in enumerate(tokens): if is_special_index_continuation(tokens, idx) or is_numeric_media_fragment(tokens, idx): continue number = episode_number(token) if number is None: continue if not is_structural_episode_candidate(tokens, idx, number): continue clean = clean_bracket(token) if idx > 0 and tokens[idx - 1] == "." and re.fullmatch(r"\d+", clean): previous_clean = clean_bracket(tokens[idx - 2]) if idx >= 2 else ""4 unmodified lines score += 4 if token.startswith("[") or token.startswith("(") or token.startswith("【"): score += 3 if idx > 0 and tokens[idx - 1] in {"-", "_", "|"}: prev_idx = previous_non_space_index(tokens, idx) if prev_idx is not None and tokens[prev_idx] in {"-", "_", "|"}: score += 2 if idx >= len(tokens) // 2: score += 136 unmodified lines return True
def split_special_composite(clean: str) -> Optional[tuple[str, Optional[str]]]: match = SPECIAL_COMPOSITE_RE.fullmatch(clean) if not match: return None return match.group("special"), match.group("episode")
def label_special_composite_contents(token: str, tokenizer: AnimeTokenizer) -> tuple[List[str], List[str]]: inner = clean_bracket(token) composite = split_special_composite(inner) if composite is None: return label_bracket_contents(token, "special", tokenizer)
special, episode = composite open_char, close_char = bracket_delimiters(token) tokens: List[str] = [] cats: List[str] = [] if open_char: tokens.append(open_char) cats.append("sep") for piece in tokenizer.tokenize(special): if is_separator_token(piece): tokens.append(piece) cats.append("sep") else: tokens.append(piece) cats.append("special") if episode: for piece in tokenizer.tokenize(episode): if is_separator_token(piece): tokens.append(piece) cats.append("sep") else: tokens.append(piece) cats.append("episode") if close_char: tokens.append(close_char) cats.append("sep") return tokens, cats
def clear_trailing_title_separators(tokens: Sequence[str], categories: List[str]) -> None: idx = len(categories) - 1 while idx >= 0 and is_separator_token(tokens[idx]) and categories[idx] == "title": categories[idx] = "sep" idx -= 1
def label_context_season_tokens( tokens: Sequence[str], categories: List[str],16 unmodified lines categories[idx] = "season"
def label_special_index_sequences(tokens: Sequence[str], categories: List[str]) -> None: """Keep NCOP_01 / NCED 16 / IV05 style codes as a single SPECIAL span.""" idx = 0 while idx < len(tokens): if not is_special_index_base(tokens[idx]): idx += 1 continue
next_idx = next_significant_index(tokens, idx) if next_idx is None or not is_special_index_continuation(tokens, next_idx): idx += 1 continue
categories[idx] = "special" for between in range(idx + 1, next_idx): if is_separator_token(tokens[between]): categories[between] = "special" categories[next_idx] = "special" idx = next_idx + 1
def repair_structured_bracket_title_aliases( tokens: Sequence[str], categories: List[str],32 unmodified lines
def embedded_bracket_episode(token: str) -> Optional[tuple[str, str, str]]: """Split malformed tokens such as '[Group}Title[658]' into title + episode.""" clean_token = clean_bracket(token) if is_special(token) or SPECIAL_INDEX_RE.match(clean_token) or SPECIAL_COMPOSITE_RE.fullmatch(clean_token): return None if has_wrapping_brackets(token) and ( HASH_RE.match(clean_token) or RESOLUTION_SEARCH_RE.search(clean_token) or MEDIA_META_RE.search(clean_token) ): return None if episode_number(token) is not None: return None match = re.match(r"^(?P<prefix>.+?)\[(?P<episode>\d{1,4}(?:v\d+)?)(?P<close>\])?$", token, re.I)6 unmodified lines close = match.group("close") or "" if not clean_bracket(prefix): return None if SPECIAL_INDEX_BASE_RE.match(clean_bracket(prefix)): return None number = int(re.search(r"\d+", episode).group()) if number == 0 or number > 2000: return None23 unmodified lines categories: Sequence[str], tokenizer: AnimeTokenizer, require_episode: bool = True, require_title: bool = True,) -> Optional[dict]: expanded_tokens, expanded_categories = expand_tokens_and_categories(tokens, categories, tokenizer)
14 unmodified lines labels = assign_iob2(expanded_categories) if len(expanded_tokens) != len(labels): return None if not any(label.endswith("TITLE") for label in labels): if require_title and not any(label.endswith("TITLE") for label in labels): return None if require_episode and not any(label.endswith("EPISODE") for label in labels): return None168 unmodified lines categories.append("source") title_allowed = False continue if is_special(token): if is_special_index_sequence_token(tokens, idx) or is_special(token): clear_trailing_title_separators(tokens, categories) categories.append("special") title_allowed = False continue if is_noise_bracket(token): categories.append("sep") continue if seen_title and not title_allowed: categories.append("sep") continue categories.append("title") seen_title = True
return finalize_weak_sample(tokens, categories, tokenizer, require_episode=False) label_special_index_sequences(tokens, categories) require_title = any(category == "title" for category in categories) return finalize_weak_sample( tokens, categories, tokenizer, require_episode=False, require_title=require_title, )
def bracket_delimiters(token: str) -> tuple[str, str]:68 unmodified lines expanded_tokens.extend([match.group(1), match.group(2)]) expanded_categories.extend(["season", "episode"]) continue if category == "special" and ( token.startswith("[") or token.startswith("(") or token.startswith("【") or token.startswith("《") ): split_tokens, split_categories = label_special_composite_contents(token, tokenizer) expanded_tokens.extend(split_tokens) expanded_categories.extend(split_categories) continue if category in {"group", "title"} and ( token.startswith("[") or token.startswith("(") or token.startswith("【") or token.startswith("《") ):45 unmodified lines categories[idx] = "resolution" elif is_source(token): categories[idx] = "source" elif is_special_index_sequence_token(tokens, idx): categories[idx] = "special" elif is_special(token): categories[idx] = "special" elif is_explicit_season(token):3 unmodified lines
episode_idx = find_episode_index(tokens) if episode_idx is None: label_special_index_sequences(tokens, categories) return fallback_embedded_episode_sample(tokens, tokenizer) or fallback_no_episode_sample(tokens, tokenizer) categories[episode_idx] = "episode" label_special_index_sequences(tokens, categories) label_context_season_tokens(tokens, categories, episode_idx) repair_structured_bracket_title_aliases(tokens, categories, episode_idx)
7 unmodified lines89101111127 unmodified lines 128, 15 ], "max_abs_diff": 5.65648078918457e-05 "max_abs_diff": 2.6702880859375e-05}12323version https://git-lfs.github.com/spec/v1oid sha256:6d967c5c2305e6737c9e791956a174655deebef2cfa477e081890ebddd56e004size 19633926oid sha256:28ac9b1e17d0e70f31a986a1d677513d97e77748ccdf96c8d77245cadc54fa4esize 19652184269 unmodified lines2702712722732742732752762772784 unmodified lines28328428528628728828929029129229329429529629729840 unmodified lines33934034133034234334434534652 unmodified lines39940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949 unmodified lines5395405414485425434504515445454534544555465475485495505515525535545555565575585595605618 unmodified lines57057157257357457557657757857958029 unmodified lines61061161261361461561661761861962062139 unmodified lines6616626636646656666676686696709 unmodified lines68068168256968368457157268568668768868969069186 unmodified lines77877978066578178278378478578678778878979079179279379479579679779879980080180280367180480580680711 unmodified lines81982082168969069182282382482582682767 unmodified lines895896897765898899900901902903904905906907269 unmodified linesSOURCE_TOKEN_PATTERN = ( r"WEB[-_ ]?DL|WEB[-_ ]?Rip|BDRip|BluRay|BDMV|BD|DVDRip|DVD|TVRip|HDTV|" r"Netflix|NF|AMZN|Baha|CR|ABEMA|DSNP|U[-_ ]?NEXT|Hulu|AT[-_ ]?X|" r"x26[45]|h\.?26[45]|HEVC|AVC|AV1|AAC\d*(?:\.\d+)?|AAC|FLAC|MP3|DTS|Opus|" r"SDR|HDR10?|UHD|REMUX|10bit|8bit|Hi10p|Ma10p|ASSx?\d*|SRTx?\d*|" r"CHS|CHT|GB|BIG5|JPN?|繁中|简中" r"CHS|CHT|GB|BIG5|JPN?|JPSC|JPTC|繁中|简中")SOURCE_RE = re.compile(rf"\b(?:{SOURCE_TOKEN_PATTERN})\b", re.I)SOURCE_TAG_RE = re.compile(4 unmodified lines r"^(?:檢索|检索|搜索|搜寻|搜尋|别名|別名|alias|search|keyword)\s*[::].+", re.I,)SPECIAL_CODE_RE = re.compile( r"^(?:NCOP|NCED|OP|ED|PV|CM)\d*$|^IV\d+$|^(?:OVA|OAD|SP)\d*$", re.I,)SPECIAL_CODE_INLINE_RE = re.compile( r"(?<![A-Za-z0-9])" r"(?P<code>(?:NCOP|NCED)(?:[\s._-]*\d{1,4})?|(?:OP|ED|PV|CM)\d{1,4}|IV\d{1,4})" r"(?![A-Za-z0-9])", re.I,)EPISODE_PATTERNS = [ ("season_episode", re.compile(r"[Ss]\d{1,2}[Ee](?P<ep>\d{1,4})(?:v\d+)?", re.I)), ("dash_episode", re.compile(r"(?:^|[\s._])[-_]\s*(?P<ep>\d{1,4})(?:v\d+)?(?=$|[\s._\-\]\)】》\[])")),40 unmodified linesNOISE_META_RE = re.compile( r"^(?:\d{3,4}[pP]|\d[Kk]|WEB[-_ ]?DL|WEB[-_ ]?Rip|BDRip|BluRay|BDMV|BD|DVDRip|DVD|TVRip|" r"HDTV|Netflix|NF|AMZN|Baha|CR|HEVC|AVC|AV1|x26[45]|h\.?26[45]|AAC.*|FLAC|MP3|DTS|" r"Opus|ASS.*|CHS|CHT|BIG5|GB|JPN?|MP4|MKV|繁中|简中|内封|外挂)$", r"Opus|SDR|HDR10?|UHD|REMUX|10bit|8bit|Hi10p|Ma10p|ASS.*|SRT.*|CHS|CHT|BIG5|GB|JPN?|" r"JPSC|JPTC|MP4|MKV|繁中|简中|内封|外挂)$", re.I,)DATE_RE = re.compile(r"^(?:19|20)\d{2}(?:[.\-_年]?(?:0?[1-9]|1[0-2]))?(?:[.\-_月]?(?:0?[1-9]|[12]\d|3[01]))?日?$")52 unmodified lines or SOURCE_TAG_RE.fullmatch(clean) or SOURCE_RE.search(clean) or SPECIAL_TAG_RE.search(clean) or SPECIAL_CODE_RE.fullmatch(normalized) or NOISE_META_RE.search(clean) )
def normalize_special_code(text: str) -> str: return re.sub(r"[\s._-]+", "", text.strip())
def special_code_spans(filename: str) -> List[Tuple[str, int, int]]: spans: List[Tuple[str, int, int]] = [] for text, start, end in bracket_parts(filename): normalized = normalize_special_code(text) if SPECIAL_CODE_RE.fullmatch(normalized): spans.append((normalized, start, end)) for match in SPECIAL_CODE_INLINE_RE.finditer(filename): normalized = normalize_special_code(match.group("code")) if SPECIAL_CODE_RE.fullmatch(normalized): spans.append((normalized, match.start("code"), match.end("code")))
deduped: List[Tuple[str, int, int]] = [] seen: set[Tuple[str, int, int]] = set() for value, start, end in sorted(spans, key=lambda item: (item[1], item[2])): key = (value.lower(), start, end) if key in seen: continue seen.add(key) deduped.append((value, start, end)) return deduped
def special_code_brackets(filename: str) -> List[Tuple[str, int, int]]: return [ (text.strip(), start, end) for text, start, end in bracket_parts(filename) if SPECIAL_CODE_RE.fullmatch(normalize_special_code(text)) ]
def span_is_inside_special_code(filename: str, start: int, end: int) -> bool: return any(special_start <= start and end <= special_end for _code, special_start, special_end in special_code_spans(filename))
def has_non_special_episode_context(filename: str, episode: int) -> bool: masked = filename for _text, start, end in reversed(special_code_brackets(filename)): masked = masked[:start] + (" " * (end - start)) + masked[end:] return plausible_episode_context(masked, episode) and best_structural_episode(masked) == episode
def episode_comes_only_from_special_code(filename: str, episode: Optional[int]) -> bool: if episode is None: return False specials = special_code_spans(filename) if not specials: return False ep_text = str(int(episode)) for normalized, _start, _end in specials: if re.search(rf"0*{re.escape(ep_text)}$", normalized): return not has_non_special_episode_context(filename, int(episode)) return False
def strip_title_special_codes(title: str, special: Optional[str] = None) -> str: cleaned = title.strip() while True: next_cleaned = re.sub( r"\s*[\[\(【《]\s*(?:(?:NCOP|NCED|OP|ED|PV|CM)\d*|IV\d+|(?:OVA|OAD|SP)\d*)\s*[\]\)】》]\s*$", "", cleaned, flags=re.I, ).strip(" \t-_.") if next_cleaned == cleaned: break cleaned = next_cleaned cleaned = re.sub(r"\s+(?:NCOP|NCED|OP|ED|PV|CM)\d*$", "", cleaned, flags=re.I).strip(" \t-_.") if special: normalized = re.sub(r"[\s._-]+", "", str(special).strip()) match = re.fullmatch(r"([A-Za-z]+)\d+", normalized) if match and SPECIAL_CODE_RE.fullmatch(normalized): prefix = re.escape(match.group(1)) cleaned = re.sub(rf"\s+{prefix}$", "", cleaned, flags=re.I).strip(" \t-_.") return cleaned or title
def looks_like_structural_group(text: str, filename: str, bracket_end: int) -> bool: """Heuristic for short leading release-group brackets not in the name list.""" if looks_like_group(text):49 unmodified lines source_matches = source_candidates(filename) current_source = repaired.get("source") preferred_source = source_matches[0] if source_matches else None if source_matches and ( if preferred_source and ( not current_source or not SOURCE_RE.fullmatch(str(current_source)) or len(str(current_source)) <= 3 and str(current_source).lower() not in {"nf", "cr"} or source_priority(preferred_source) > source_priority(str(current_source)) or ( preferred_source and str(current_source).lower().replace("_", "-") in {"web-dl", "webdl", "webrip", "web-rip"} and preferred_source.lower().replace("_", "-") not in {"web-dl", "webdl", "webrip", "web-rip"} source_priority(preferred_source) == source_priority(str(current_source)) and preferred_source.lower() != str(current_source).lower() ) ): repaired["source"] = preferred_source
special_spans = special_code_spans(filename) current_special = repaired.get("special") if special_spans: preferred_special = special_spans[0][0] current_normalized = normalize_special_code(str(current_special)) if current_special else "" if not current_special or preferred_special.lower().startswith(current_normalized.lower()): repaired["special"] = preferred_special if not repaired.get("special"): for text, _start, _end in brackets: clean = text.strip()8 unmodified lines ): repaired["episode"] = episode
if repaired.get("episode") is not None and not plausible_episode_context(filename, int(repaired["episode"])): repaired["episode"] = episode if episode_comes_only_from_special_code(filename, repaired.get("episode")): repaired["episode"] = None
if repaired.get("season") is None: match = SEASON_RE.search(filename) if match:29 unmodified lines
if repaired.get("title") and repaired.get("season") is not None: repaired["title"] = strip_trailing_season_from_title(repaired["title"], repaired["season"]) if repaired.get("episode") is None and repaired.get("group") and repaired.get("special"): inferred_title = infer_title_span(filename, repaired.get("group"), None) if inferred_title: repaired["title"] = inferred_title if repaired.get("title"): repaired["title"] = strip_title_special_codes(repaired["title"], repaired.get("special"))
return repaired
39 unmodified lines if marker.lower() == "ni" and "Kakuriyo no Yadomeshi Ni" not in prefix: continue return marker, value
numeric_tail = re.search(r"(?:^|[\s._-])(?P<season>[2-9])$", prefix) if numeric_tail: return numeric_tail.group("season"), int(numeric_tail.group("season")) return None
9 unmodified linesdef source_priority(source: str) -> int: normalized = source.lower().replace("_", "-").replace(" ", "") parts = re.split(r"[&+/,]", normalized) if any(part in {"nf", "netflix", "amzn", "baha", "cr", "abema", "dsnp", "u-next", "hulu", "at-x"} for part in parts): if any(part in {"nf", "netflix", "amzn", "baha", "cr", "abema", "dsnp", "u-next", "hulu", "at-x", "web-dl", "webdl", "webrip", "web-rip", "bdrip", "bluray", "bdmv", "bd", "dvdrip", "dvd", "tvrip", "hdtv"} for part in parts): return 90 if any(part in {"web-dl", "webdl", "webrip", "web-rip", "bdrip", "bluray", "bdmv", "bd", "dvdrip", "dvd", "tvrip", "hdtv"} for part in parts): return 60 if any(part in {"chs", "cht", "gb", "big5", "jpn", "jpsc", "jptc", "繁中", "简中"} for part in parts): return 70 if any(part in {"x264", "x265", "h.264", "h264", "h.265", "h265", "hevc", "avc", "av1", "aac", "flac", "mp3", "dts", "opus", "10bit", "8bit", "hi10p", "ma10p", "srt", "srtx2", "ass", "assx2"} for part in parts): return 20 if len(parts) > 1: return 40 return 2086 unmodified lines ep = int(ep_text) if ep == 0 or ep > 2000: continue context = filename[max(0, match.start() - 5):match.end() + 5] ep_start = match.start("ep") ep_end = match.end("ep") if span_is_inside_special_code(filename, ep_start, ep_end): continue if name == "generic_episode": tail = filename[ep_end:] if re.match(r"[-_][A-Za-z]", tail): continue if not re.match( r"(?:$|[\]\)】》]|[\s._-]+(?:" r"\[[^\]]*(?:\d{3,4}[pP]|WEB|BD|BluRay|HDTV|NF|AMZN|CR|Baha|Ma10p|x26|HEVC|AVC)|" r"\d{3,4}[pP]|WEB|BD|BluRay|HDTV|NF|AMZN|CR|Baha|Ma10p|x26|HEVC|AVC|mkv|mp4|avi" r"))", tail, re.I, ): continue context = filename[max(0, ep_start - 5):ep_end + 5] if RESOLUTION_RE.search(context) or re.search(r"AAC|DDP|AC3|H\.?26[45]|x26[45]", context, re.I): continue priority = priorities[name] if 1 <= ep <= 200: priority += 20 candidates.append((priority, match.start(), ep)) candidates.append((priority, ep_start, ep)) if not candidates: return None return max(candidates, key=lambda item: (item[0], item[1]))[2]11 unmodified lines rf"(?:^|[\s._\-\[\(【《#])(?:EP?|第|#)0*{episode}(?:v\d+)?(?:[话話集])?(?=$|[\s._\-\]\)】》])", rf"(?:^|[\s._\-\[\(【《])0*{episode}(?:v\d+)?(?=[\s._\-\]\)】》\[]+(?:\d{{3,4}}[pP]|WEB|BD|BluRay|HDTV|NF|AMZN|CR|Baha))", ] return any(re.search(pattern, filename, re.I) for pattern in patterns) or bool( re.search(rf"(?:^|[\s._\-\[\(【《])(?:{re.escape(ep_text)}|{re.escape(padded)})(?=$|[\s._\-\]\)】》])", filename) ) if any(re.search(pattern, filename, re.I) for pattern in patterns): return True return bool(re.search(rf"(?:^|[\s._-])(?:{re.escape(ep_text)}|{re.escape(padded)})(?:v\d+)?$", filename, re.I))
def strip_trailing_season_from_title(title: str, season: int) -> str:67 unmodified lines for text, bracket_start, _bracket_end in bracket_parts(filename): if bracket_start <= start: continue if NOISE_META_RE.search(text) or RESOLUTION_RE.search(text) or SOURCE_RE.search(text): if ( NOISE_META_RE.search(text) or RESOLUTION_RE.search(text) or SOURCE_RE.search(text) or SPECIAL_TAG_RE.search(text) or SPECIAL_CODE_RE.fullmatch(re.sub(r"[\s._-]+", "", text.strip())) ): end = bracket_start break
116 unmodified lines117118119120121122123124125126250 unmodified lines377378379376380381382383116 unmodified lines r"^(?:檢索|检索|搜索|搜寻|搜尋|别名|別名|alias|search|keyword)\s*[::].+", re.I,)SPECIAL_CODE_RE = re.compile( r"^(?:NCOP|NCED|OP|ED|PV|CM)\d*$|^IV\d+$|^(?:OVA|OAD|SP)\d*$", re.I,)
READING_MARKER_RE = re.compile( r"(?<![A-Za-z0-9])"250 unmodified lines if not clean: continue
if SPECIAL_TAG_RE.fullmatch(clean): if SPECIAL_TAG_RE.fullmatch(clean) or SPECIAL_CODE_RE.fullmatch(clean): indices = token_indices_for_span(offsets, inner_start, inner_end) if safe_to_overwrite_meta(labels, indices) and label_span_if_changed(labels, indices, "SPECIAL"): repairs.append(LabelRepair("special", clean, 0, inner_start, inner_end))1223version https://git-lfs.github.com/spec/v1oid sha256:347b2f619fd63a71804c4742a069b20acd0cde870fc03cc2ac0f175b06586b72oid sha256:9f251f8d4bbb750ba3bfd6fceffbec32eff3f32e9f07820bdab48294052d15a5size 19142604122345674567891091011121314151617181913141516171819202122232425262728222324252627282930313230313233343535363738393738394041424344434445464748464748495051525354555657585960616263646566676869707172737475767778525379808182565783848586878862899064656691929394959670719798997374751001011021031041057980106107108828384851091101111121131141158911611711892931191201211229697123124125126127101102128129130104105106107131132133134135136110111137138139113114115116140141142143144145146120147148122123124149150151152153154128129155156157131132133134158159160161162163137138164165166140141142143167168169170171172173147174175176177151178179180181182183184185186156187188158189190191161192193194195165166167196197198199200170201202203204174205206176177178207208209210211212182183213214215185186187188216217218219220221191192222223224194195196197225226227228229230231201232233203204205234235236237238239209210240241242212213214215243244245246247248218219249250251252222223224253254255256257258228259260230231232261262263264265266236237267268269239240241242270271272273274275245246276277278248249250251279280281282283284285255286287257288289259290291292293294264295296266297298299269300301302303273274275304305306307308278309310311312282313314284285286315316317318319320290291292293294295296321322323324325326327328329299300301302303304305330331332333334335336337338339309340341311342343313314315316317344345346347321322348349350324325326327351352353354355356330331332333334335336357358359360361362363364365366340367368342343344345369347348370371372373374352353375376377355356357358378379380381382383361362384385386364365366367387388389390391392393371394395396374375397398399400401379380402403404382383384385405406407408409410388389411412413391392393394414415416417418419420398421422423401402424425426427428406407408409410411412429430431432433434435436437415416417418419420421438439440441442443444445446447425448449427428429450451452453454455433434456457458436437438439459460461462463464442443465466467445446447448468469470471472473474452475476454455456457458459460477478479480481482464465466467468469470483484485486487488489490491473474492493494476477478479495496497498499500501483502503485504505487506507508509491492510511512494495496497513514515516517518500501502503504505506519520521522523524525526527528510529530512531532514533534535536518519537538539521522523524540541542543544545527528529530531532533546547548549550551552553554555537556557539540541558559560561562563545546564565566548549550551567568569570571572554555556557558559560573574575576577578579580581582{ "sample_count": 2048, "sample_count": 512, "field_accuracy": { "group": 0.99951171875, "title": 0.99755859375, "season": 0.99609375, "episode": 0.998046875, "group": 1.0, "title": 0.974609375, "season": 0.98046875, "episode": 0.806640625, "resolution": 1.0, "source": 0.99853515625, "special": 0.9990234375 "source": 0.998046875, "special": 0.96875 }, "field_correct": { "group": 2047, "title": 2043, "season": 2040, "episode": 2044, "resolution": 2048, "source": 2045, "special": 2046 "group": 512, "title": 499, "season": 502, "episode": 413, "resolution": 512, "source": 511, "special": 496 }, "field_total": { "group": 2048, "title": 2048, "season": 2048, "episode": 2048, "resolution": 2048, "source": 2048, "special": 2048 "group": 512, "title": 512, "season": 512, "episode": 512, "resolution": 512, "source": 512, "special": 512 }, "full_match_accuracy": 0.99072265625, "full_match_correct": 2029, "full_match_total": 2048, "full_match_accuracy": 0.751953125, "full_match_correct": 385, "full_match_total": 512, "failures": [ { "filename": "[ig]Itai no wa Iya nano de Bougyoryoku ni Kyokufuri Shitai to Omoimasu[WebRip 1920x1080 AVC YUV420 8Bit 1080p AAC].03.TC", "filename": "[ReinForce] Sword Art Online II - ED3 (BDRip 1920x1080 x264 FLAC)", "errors": { "episode": { "gold": "3", "pred": null "season": { "gold": null, "pred": "2" } }, "gold": { "group": "ig", "title": "Itai no wa Iya nano de Bougyoryoku ni Kyokufuri Shitai to Omoimasu", "group": "ReinForce", "title": "Sword Art Online II", "season": null, "episode": 3, "resolution": "1080p", "source": "WebRip", "episode": null, "resolution": "1920x1080", "source": "BDRip", "special": "ED3" }, "pred": { "group": "ReinForce", "title": "Sword Art Online II", "season": 2, "episode": null, "resolution": "1920x1080", "source": "BDRip", "special": "ED3" } }, { "filename": "[アニメ DVD] 銀装騎攻オーディアン ACT.06 特典映像 川田&榎本トーク (DVD 640x480 WMV9 QB90 30fps MP3 192kbps)", "errors": { "title": { "gold": "銀装騎攻オーディアン act.06 特典映像 川田&榎本トーク", "pred": "銀装騎攻オーディアン act.06 特典映像 川田" } }, "gold": { "group": "アニメ DVD", "title": "銀装騎攻オーディアン ACT.06 特典映像 川田&榎本トーク", "season": null, "episode": null, "resolution": "640x480", "source": "DVD", "special": null }, "pred": { "group": "ig", "title": "Itai no wa Iya nano de Bougyoryoku ni Kyokufuri Shitai to Omoimasu", "group": "アニメ DVD", "title": "銀装騎攻オーディアン ACT.06 特典映像 川田", "season": null, "episode": null, "resolution": "1080p", "source": "WebRip", "resolution": "640x480", "source": "DVD", "special": null } }, { "filename": "[YYDM-11FANS][Nanana's Buried Treasure][preview][09][BDrip][720P][X264-10bit_AAC][34D29ED6]", "filename": "05-ラディアン 第2シリーズ_ED", "errors": { "special": { "gold": "ed", "pred": null "title": { "gold": "05-ラディアン 第2シリーズ", "pred": "05-ラディアン 第2" } }, "gold": { "group": "YYDM-11FANS", "title": "Nanana's Buried Treasure", "group": null, "title": "05-ラディアン 第2シリーズ", "season": null, "episode": 9, "resolution": "720P", "source": "BDrip", "episode": null, "resolution": null, "source": null, "special": "ED" }, "pred": { "group": "YYDM-11FANS", "title": "Nanana's Buried Treasure", "group": null, "title": "05-ラディアン 第2", "season": null, "episode": 9, "resolution": "720P", "source": "BDrip", "special": null "episode": null, "resolution": null, "source": null, "special": "ED" } }, { "filename": "[Moozzi2] Madou King Granzort Saigo no Magical Taisen OVA - 01 [ 1990 ] (BD 1440x1080 x.264 Flac)", "filename": "[A.A] hinotori 03", "errors": { "title": { "gold": "madou king granzort saigo no magical taisen ova", "pred": "madou king granzort saigo no magical taisen ova - 01 [ 1990" "gold": "hinotori 03", "pred": "hinotori" }, "episode": { "gold": "1", "pred": "1990" "gold": null, "pred": "3" } }, "gold": { "group": "Moozzi2", "title": "Madou King Granzort Saigo no Magical Taisen OVA", "group": "A.A", "title": "hinotori 03", "season": null, "episode": 1, "resolution": "1440x1080", "source": "BD", "special": "OVA" "episode": null, "resolution": null, "source": null, "special": null }, "pred": { "group": "Moozzi2", "title": "Madou King Granzort Saigo no Magical Taisen OVA - 01 [ 1990 ", "group": "A.A", "title": "hinotori", "season": null, "episode": 1990, "resolution": "1440x1080", "source": "BD", "special": "OVA" "episode": 3, "resolution": null, "source": null, "special": null } }, { "filename": "[64bitsub][Tensui no Sakuna-hime][08][BDRIP_1920x1080][AVC_FLAC_SUP]", "filename": "[Nekomoe kissaten] Azur Lane Bisoku Zenshin! [ED][05][BDRip 1080p HEVC-10bit FLAC]", "errors": { "source": { "gold": "flac", "pred": "avc-flac" "episode": { "gold": null, "pred": "5" } }, "gold": { "group": "64bitsub", "title": "Tensui no Sakuna-hime", "group": "Nekomoe kissaten", "title": "Azur Lane Bisoku Zenshin! [ED", "season": null, "episode": 8, "resolution": "1920x1080", "source": "FLAC", "special": null "episode": null, "resolution": "1080p", "source": "BDRip", "special": "05" }, "pred": { "group": "64bitsub", "title": "Tensui no Sakuna-hime", "group": "Nekomoe kissaten", "title": "Azur Lane Bisoku Zenshin! [ED", "season": null, "episode": 8, "resolution": "1920x1080", "source": "AVC_FLAC", "special": null "episode": 5, "resolution": "1080p", "source": "BDRip", "special": "05" } }, { "filename": "[VCB-Studio] Shingeki no Kyojin Movie 3 Kakusei no Houkou [Teaser_S3][Ma10p_1080p][x265_flac]", "filename": "[VCB-Studio] Danmachi IV [10][Ma10p_1080p][x265_flac]", "errors": { "season": { "gold": null, "pred": "3" "pred": "4" }, "episode": { "gold": null, "pred": "10" } }, "gold": { "group": "VCB-Studio", "title": "Shingeki no Kyojin Movie 3 Kakusei no Houkou [Teaser_S3", "title": "Danmachi", "season": null, "episode": 3, "episode": null, "resolution": "1080p", "source": "x265_flac", "special": "Movie" "special": "10" }, "pred": { "group": "VCB-Studio", "title": "Shingeki no Kyojin Movie 3 Kakusei no Houkou [Teaser_S3", "season": 3, "episode": 3, "title": "Danmachi", "season": 4, "episode": 10, "resolution": "1080p", "source": "x265_flac", "special": "Movie" "special": "10" } }, { "filename": "FF:U ファイナルファンタジー:アンリミテッド ~異界の章~ #15 「ジェーン~うごきだすうみパズル」(DVD 640x480 DivX5 QB98 120fps lameVBR)[CRC_5FA44899]", "filename": "[FZSD&DBD-Raws][King of Prism Dramatic Prism.1][PV][12][1080P][BDRip][HEVC-10bit][FLAC]", "errors": { "source": { "gold": "cr", "pred": "dvd" "episode": { "gold": null, "pred": "12" } }, "gold": { "group": null, "title": "FF:U ファイナルファンタジー:アンリミテッド ~異界の章~", "group": "FZSD&DBD-Raws", "title": "King of Prism Dramatic Prism.1", "season": null, "episode": 15, "resolution": "640x480", "source": "CR", "special": null "episode": null, "resolution": "1080P", "source": "BDRip", "special": "12" }, "pred": { "group": null, "title": "FF:U ファイナルファンタジー:アンリミテッド ~異界の章~", "group": "FZSD&DBD-Raws", "title": "King of Prism Dramatic Prism.1", "season": null, "episode": 15, "resolution": "640x480", "source": "DVD", "special": null "episode": 12, "resolution": "1080P", "source": "BDRip", "special": "12" } }, { "filename": "[OVA]GALLFORCE ガルフォース2 宇宙章 vol2 [DESTRUCTION]", "filename": "[SAIO-Raws] Wakaokami wa Shougakusei! PV 02 [BD 1920x1080 HEVC-10bit OPUS]", "errors": { "title": { "gold": "gallforce ガルフォース2 宇宙章 vol", "pred": "gallforce ガルフォース2 宇宙" "episode": { "gold": null, "pred": "2" } }, "gold": { "group": "OVA", "title": "GALLFORCE ガルフォース2 宇宙章 vol", "group": "SAIO-Raws", "title": "Wakaokami wa Shougakusei! PV 02", "season": null, "episode": 2, "resolution": null, "source": null, "special": "OVA" "episode": null, "resolution": "1920x1080", "source": "BD", "special": "PV 02" }, "pred": { "group": "OVA", "title": "GALLFORCE ガルフォース2 宇宙", "group": "SAIO-Raws", "title": "Wakaokami wa Shougakusei! PV 02", "season": null, "episode": 2, "resolution": null, "source": null, "special": "OVA" "resolution": "1920x1080", "source": "BD", "special": "PV 02" } }, { "filename": "[病毒].[Fosky_Fansub][Virus_Buster_Serge][DVDrip][12][H264_AAC][640x480][GB&BIG5][F77551D0](ED2000.COM)", "filename": "[DBD-Raws][Hime-sama Goumon no Jikan Desu][PV][01][1080P][BDRip][HEVC-10bit][FLAC]", "errors": { "special": { "gold": "ed", "pred": "e" "episode": { "gold": null, "pred": "1" } }, "gold": { "group": "病毒", "title": "Fosky_Fansub", "group": "DBD-Raws", "title": "Hime-sama Goumon no Jikan Desu", "season": null, "episode": 12, "resolution": "640x480", "source": "DVDrip", "special": "ED" "episode": null, "resolution": "1080P", "source": "BDRip", "special": "01" }, "pred": { "group": "病毒", "title": "Fosky_Fansub", "group": "DBD-Raws", "title": "Hime-sama Goumon no Jikan Desu", "season": null, "episode": 12, "resolution": "640x480", "source": "DVDrip", "special": "E" "episode": 1, "resolution": "1080P", "source": "BDRip", "special": "01" } }, { "filename": "[DBD-Raws][Shadows House S1][Gekijou][18][1080P][BDRip][HEVC-10bit][FLAC]", "filename": "[DBD-Raws][Tenshi no 3P!][PV][03][1080P][BDRip][HEVC-10bit][FLAC]", "errors": { "season": { "episode": { "gold": null, "pred": "1" "pred": "3" } }, "gold": { "group": "DBD-Raws", "title": "Shadows House", "title": "Tenshi no 3P!", "season": null, "episode": 18, "episode": null, "resolution": "1080P", "source": "BDRip", "special": null "special": "03" }, "pred": { "group": "DBD-Raws", "title": "Shadows House", "season": 1, "episode": 18, "title": "Tenshi no 3P!", "season": null, "episode": 3, "resolution": "1080P", "source": "BDRip", "special": null "special": "03" } }, { "filename": "Girls und Panzer - 10.5 (BD 1280x720 AVC AACx2)", "filename": "[Suzu-Kaze] DanMachi IV 21 [WebRip 1920x1080 HEVC YUV420P10 AAC]", "errors": { "season": { "gold": "10", "pred": "1" "episode": { "gold": null, "pred": "21" } }, "gold": { "group": null, "title": "Girls und Panzer - 10.5", "season": 10, "episode": 5, "resolution": "1280x720", "source": "BD", "special": null "group": "Suzu-Kaze", "title": "DanMachi IV 21", "season": null, "episode": null, "resolution": "1920x1080", "source": "WebRip", "special": "IV 21" }, "pred": { "group": null, "title": "Girls und Panzer - 10.5", "season": 1, "episode": 5, "resolution": "1280x720", "source": "BD", "special": null "group": "Suzu-Kaze", "title": "DanMachi IV 21", "season": null, "episode": 21, "resolution": "1920x1080", "source": "WebRip", "special": "IV 21" } }, { "filename": "[POPGO&SumiSora&TxxZ] Ginga Eiyuu Densetsu Die Neue These - Seiran 14 (BDRip 1080P X265 Main10p TrueHDX2 Chap)[A4E18C32]", "filename": "[VCB-Studio] Log Horizon 2 [IV03][Ma10p_1080p][x265_aac]", "errors": { "group": { "season": { "gold": null, "pred": "popgo&sumisora&txxz" }, "title": { "gold": "popgo&sumisora&txxz", "pred": "ginga eiyuu densetsu die neue these - seiran 14" "pred": "2" } }, "gold": { "group": null, "title": "POPGO&SumiSora&TxxZ", "group": "VCB-Studio", "title": "Log Horizon 2", "season": null, "episode": 14, "resolution": "1080P", "source": "BDRip", "special": null "episode": null, "resolution": "1080p", "source": "x265_aac", "special": "IV03" }, "pred": { "group": "POPGO&SumiSora&TxxZ", "title": "Ginga Eiyuu Densetsu Die Neue These - Seiran 14", "season": null, "episode": 14, "resolution": "1080P", "source": "BDRip", "special": null "group": "VCB-Studio", "title": "Log Horizon 2", "season": 2, "episode": null, "resolution": "1080p", "source": "x265_aac", "special": "IV03" } }, { "filename": "[アニメ BD] Serial Experiments Lain 映像特典 「trailer 01」 (1440x1080 x264 AAC 2ch)", "filename": "[DBD-Raws][Mahou Shoujo Lyrical Nanoha The Movie 2nd A's][PV][06][1080P][BDRip][HEVC-10bit][FLAC]", "errors": { "title": { "gold": "serial experiments lain 映像特典 「trailer 01」", "pred": "serial experiments lain 映像特典 「trailer" }, "episode": { "gold": "2", "pred": "1" "gold": null, "pred": "6" } }, "gold": { "group": "アニメ BD", "title": "Serial Experiments Lain 映像特典 「trailer 01」", "group": "DBD-Raws", "title": "Mahou Shoujo Lyrical Nanoha The Movie 2nd A's", "season": null, "episode": 2, "resolution": "1440x1080", "source": "BD", "special": null "episode": null, "resolution": "1080P", "source": "BDRip", "special": "06" }, "pred": { "group": "アニメ BD", "title": "Serial Experiments Lain 映像特典 「trailer", "group": "DBD-Raws", "title": "Mahou Shoujo Lyrical Nanoha The Movie 2nd A's", "season": null, "episode": 1, "resolution": "1440x1080", "source": "BD", "special": null "episode": 6, "resolution": "1080P", "source": "BDRip", "special": "06" } }, { "filename": "[AJZ&BLU][God Eater][05][BIG5][v2] (2)", "filename": "[DBD-Raws][Hana wa Saku, Shura no Gotoku][PV][11][1080P][BDRip][HEVC-10bit][FLAC]", "errors": { "episode": { "gold": "2", "pred": "5" "gold": null, "pred": "11" } }, "gold": { "group": "AJZ&BLU", "title": "God Eater", "group": "DBD-Raws", "title": "Hana wa Saku, Shura no Gotoku", "season": null, "episode": 2, "resolution": null, "source": "BIG5", "special": null "episode": null, "resolution": "1080P", "source": "BDRip", "special": "11" }, "pred": { "group": "AJZ&BLU", "title": "God Eater", "group": "DBD-Raws", "title": "Hana wa Saku, Shura no Gotoku", "season": null, "episode": 5, "resolution": null, "source": "BIG5", "special": null "episode": 11, "resolution": "1080P", "source": "BDRip", "special": "11" } }, { "filename": "(アニメ) YAT安心!宇宙旅行 第1期 第07話 「サバイバル!野生のカネア」 (LD 640x480 WMV9 QB90 24fps)", "filename": "[Seed-Raws] Strike the Blood IV - OVA Vol.01 Menu 02 (BD 1280x720 AVC AAC)", "errors": { "season": { "gold": null, "pred": "1" "gold": "4", "pred": null } }, "gold": { "group": "アニメ", "title": "YAT安心!宇宙旅行", "season": null, "episode": 7, "resolution": "640x480", "source": null, "special": null "group": "Seed-Raws", "title": "Strike the Blood IV - OVA Vol.01 Menu 02", "season": 4, "episode": null, "resolution": "1280x720", "source": "BD", "special": "OVA" }, "pred": { "group": "アニメ", "title": "YAT安心!宇宙旅行", "season": 1, "episode": 7, "resolution": "640x480", "source": null, "special": null "group": "Seed-Raws", "title": "Strike the Blood IV - OVA Vol.01 Menu 02", "season": null, "episode": null, "resolution": "1280x720", "source": "BD", "special": "OVA" } }, { "filename": "Lord El-Melloi II-sei no Jikenbo 06 [1AAC021C]", "filename": "[DBD-Raws][Hametsu no Oukoku][PV][05][1080P][BDRip][HEVC-10bit][FLAC]", "errors": { "source": { "gold": "aac", "pred": null "episode": { "gold": null, "pred": "5" } }, "gold": { "group": null, "title": "Lord El-Melloi II-sei no Jikenbo", "group": "DBD-Raws", "title": "Hametsu no Oukoku", "season": null, "episode": 6, "resolution": null, "source": "AAC", "special": null "episode": null, "resolution": "1080P", "source": "BDRip", "special": "05" }, "pred": { "group": null, "title": "Lord El-Melloi II-sei no Jikenbo", "group": "DBD-Raws", "title": "Hametsu no Oukoku", "season": null, "episode": 6, "resolution": null, "source": null, "special": null "episode": 5, "resolution": "1080P", "source": "BDRip", "special": "05" } }, { "filename": "[Skymoon-Raws] Mashle 2nd Season - 01(13) [ViuTV][WEB-DL][1080p][AVC AAC]", "filename": "[DBD-Raws][Tate no Yuusha no Nariagari S1][PV][03][1080P][BDRip][HEVC-10bit][FLAC]", "errors": { "title": { "gold": "mashle 2nd season - 01", "pred": "mashle 2nd season" }, "season": { "gold": "2", "pred": "1" "episode": { "gold": null, "pred": "3" } }, "gold": { "group": "Skymoon-Raws", "title": "Mashle 2nd Season - 01", "season": 2, "episode": 13, "resolution": "1080p", "source": "WEB-DL", "special": null "group": "DBD-Raws", "title": "Tate no Yuusha no Nariagari", "season": 1, "episode": null, "resolution": "1080P", "source": "BDRip", "special": "03" }, "pred": { "group": "Skymoon-Raws", "title": "Mashle 2nd Season", "group": "DBD-Raws", "title": "Tate no Yuusha no Nariagari", "season": 1, "episode": 13, "resolution": "1080p", "source": "WEB-DL", "special": null "episode": 3, "resolution": "1080P", "source": "BDRip", "special": "03" } }, { "filename": "【CXRAW】【S17】【Power Rangers RPM】【30】【End Game】【x264 Hi10p AAC】【MP4】", "filename": "[DBD-Raws][Kimi no Iro][PV][12][1080P][BDRip][HEVC-10bit][FLAC]", "errors": { "season": { "episode": { "gold": null, "pred": "17" "pred": "12" } }, "gold": { "group": "CXRAW", "title": "S17", "group": "DBD-Raws", "title": "Kimi no Iro", "season": null, "episode": 30, "resolution": null, "source": "AAC", "special": null "episode": null, "resolution": "1080P", "source": "BDRip", "special": "12" }, "pred": { "group": "CXRAW", "title": "S17", "season": 17, "episode": 30, "resolution": null, "source": "AAC", "special": null "group": "DBD-Raws", "title": "Kimi no Iro", "season": null, "episode": 12, "resolution": "1080P", "source": "BDRip", "special": "12" } }, { "filename": "(アニメ) YAT安心!宇宙旅行 第1期 第24話 「モーレツ!かあちゃん珍道中」 (LD 640x480 WMV9 QB90 24fps)", "filename": "[DBD-Raws][Hime-sama Goumon no Jikan Desu][PV][02][1080P][BDRip][HEVC-10bit][FLAC]", "errors": { "season": { "episode": { "gold": null, "pred": "1" "pred": "2" } }, "gold": { "group": "アニメ", "title": "YAT安心!宇宙旅行", "group": "DBD-Raws", "title": "Hime-sama Goumon no Jikan Desu", "season": null, "episode": 24, "resolution": "640x480", "source": null, "special": null "episode": null, "resolution": "1080P", "source": "BDRip", "special": "02" }, "pred": { "group": "アニメ", "title": "YAT安心!宇宙旅行", "season": 1, "episode": 24, "resolution": "640x480", "source": null, "special": null "group": "DBD-Raws", "title": "Hime-sama Goumon no Jikan Desu", "season": null, "episode": 2, "resolution": "1080P", "source": "BDRip", "special": "02" } }, { "filename": "[Snow-Raws] アイドルマスター シンデレラガールズ劇場 第2期 SP17 (DVD 1280x720 HEVC-YUV420P10 FLAC)", "filename": "Mahou.no.Angel.Sweet.Mint.TV.1990.DVDRip-Hi.x264.AC3.1024.EP21-nezumi", "errors": { "season": { "gold": null, "pred": "2" "title": { "gold": "mahou.no.angel.sweet.mint.tv.1990. -hi. .ac", "pred": "mahou.no.angel.sweet.mint.tv.1 -h" } }, "gold": { "group": "Snow-Raws", "title": "アイドルマスター シンデレラガールズ劇場 第2期 SP17", "group": null, "title": "Mahou.no.Angel.Sweet.Mint.TV.1990. -Hi. .AC", "season": null, "episode": 17, "resolution": "1280x720", "source": "DVD", "special": "SP" "episode": 21, "resolution": null, "source": "DVDRip", "special": null }, "pred": { "group": "Snow-Raws", "title": "アイドルマスター シンデレラガールズ劇場 第2期 SP17", "season": 2, "episode": 17, "resolution": "1280x720", "source": "DVD", "special": "SP" "group": null, "title": "Mahou.no.Angel.Sweet.Mint.TV.1 -H", "season": null, "episode": 21, "resolution": null, "source": "DVDRip", "special": null } } ]123234562 unmodified lines9101112131415161718192012131415161718192021222223{ "experiment_name": "dmhy-char-guoman-relabel", "data_file": "datasets/AnimeName/dmhy_weak_char.jsonl", "experiment_name": "dmhy-char-special-focus2", "data_file": "data/repair_focus_char.jsonl", "tokenizer_variant": "char", "vocab_file": "datasets/AnimeName/vocab.char.json", "vocab_size": 6199,2 unmodified lines "num_hidden_layers": 4, "num_attention_heads": 8, "intermediate_size": 1024, "train_samples": 619361, "eval_samples": 12641, "epochs": 2.0, "batch_size": 256, "learning_rate": 8e-05, "warmup_steps": 300, "seed": 52, "device": "cuda", "fp16": true, "train_samples": 68939, "eval_samples": 3629, "epochs": 1.0, "batch_size": 64, "learning_rate": 3e-05, "warmup_steps": 50, "seed": 75, "device": "cpu", "fp16": false, "gradient_accumulation_steps": 1, "dataloader_num_workers": 4 "dataloader_num_workers": 0}12345678910234567891011{ "eval_loss": 0.005763721186667681, "eval_precision": 0.9921522239605195, "eval_recall": 0.9946191314105016, "eval_f1": 0.9933841461473317, "eval_accuracy": 0.9980711558885925, "eval_runtime": 45.558, "eval_samples_per_second": 277.471, "eval_steps_per_second": 1.098, "epoch": 2.0 "eval_loss": 0.03365034610033035, "eval_precision": 0.9612760834670947, "eval_recall": 0.9719629960236955, "eval_f1": 0.9665900012105072, "eval_accuracy": 0.990421109705404, "eval_runtime": 13.2008, "eval_samples_per_second": 274.908, "eval_steps_per_second": 4.318, "epoch": 1.0}1223version https://git-lfs.github.com/spec/v1oid sha256:f01503ec029ec161063c2d78a00732c80072525b8d258c7c717b2e21f4f55d93oid sha256:b23b375ad7f991bc460e29c07b8250afa09ec2d62bad255e0fc6125f0982c56dsize 5265build_repair_focus_dataset.py+65
case_metrics.json+100-14
data/parser_regression_cases.json+47
datasets/AnimeName+1-1
dmhy_dataset.py+273-6
exports/anime_filename_parser.metadata.json+1-1
exports/anime_filename_parser.onnx+2-2
inference.py+156-17
label_repairs.py+5-1
model.safetensors+1-1
parse_eval_metrics.json+345-326
run_metadata.json+12-12
trainer_eval_metrics.json+9-9
training_args.bin+1-1