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 lines567891011121314153 unmodified lines19202122232499 unmodified lines1241251261271281293 unmodified lines13313413513613713811 unmodified lines1501511521531541556 unmodified lines1621631641651661679 unmodified lines1771781791801811824 unmodified linesimport argparseimport jsonimport randomfrom pathlib import Pathfrom typing import Iterable, Listfrom label_repairs import repair_jsonl_itemdef parse_args() -> argparse.Namespace:parser = argparse.ArgumentParser(description="Build repair-focused char JSONL fine-tune data")3 unmodified lineshelp="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-manual", type=int, default=24,help="Repeat hand-labeled hard cases")parser.add_argument("--seed", type=int, default=42)99 unmodified lines("4K", "RESOLUTION"),],)def main() -> None:3 unmodified linesoutput_path = Path(args.output)repaired_rows: List[dict] = []reservoir: List[dict] = []seen_filenames = set()total_rows = 011 unmodified linesif filename:seen_filenames.add(filename)continueif filename in seen_filenames:continueif len(reservoir) < args.context_samples:6 unmodified linesrows: List[dict] = []for item in repaired_rows:rows.extend([item] * max(1, args.repeat_repaired))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),"context_rows": len(reservoir),"manual_rows": len(list(manual_cases())),"written_rows": len(rows),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, Listfrom label_repairs import repair_jsonl_itemSPECIAL_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 lineshelp="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 linesoutput_path = Path(args.output)repaired_rows: List[dict] = []focus_rows: List[dict] = []reservoir: List[dict] = []seen_filenames = set()total_rows = 011 unmodified linesif filename:seen_filenames.add(filename)continueif 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] = itemcontinueif filename in seen_filenames:continueif len(reservoir) < args.context_samples:6 unmodified linesrows: 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 lines56789101112131415161718192021222324252627282930445 unmodified lines4764774784794804814 unmodified lines"max_length": 128,"use_rules": true,"constrain_bio": true,"case_count": 22,"full_correct": 22,"full_accuracy": 1.0,"field_correct": {"group": 19,"title": 22,"episode": 22,"resolution": 22,"source": 15,"season": 9,"special": 1},"field_total": {"group": 19,"title": 22,"episode": 22,"resolution": 22,"source": 15,"season": 9,"special": 1},"field_accuracy": {"episode": 1.0,445 unmodified lines"source": "GB","title": "逆天邪神"}}]}4 unmodified lines56789101112131415161718192021222324252627282930445 unmodified lines4764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665674 unmodified lines"max_length": 128,"use_rules": true,"constrain_bio": true,"case_count": 26,"full_correct": 26,"full_accuracy": 1.0,"field_correct": {"group": 22,"title": 26,"episode": 26,"resolution": 26,"source": 19,"season": 9,"special": 5},"field_total": {"group": 22,"title": 26,"episode": 26,"resolution": 26,"source": 19,"season": 9,"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 lines240241242243244239 unmodified lines"resolution": "4K","source": "GB"}}]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"}}]
1Subproject commit 004a8c08628b6820fb2d1b59a80fdcfe925ef0951Subproject commit c40cb38963a390a61c6d375409031f8a6c5eb927
32 unmodified lines3334353637381 unmodified line4041424344454625 unmodified lines72737475767778798067 unmodified lines14814915015115215343 unmodified lines19719819920020120220365 unmodified lines2692702712722732742752762774 unmodified lines28228328428528628728836 unmodified lines32532632732832933016 unmodified lines34734834935035135232 unmodified lines3853863873883893906 unmodified lines39739839940040140223 unmodified lines42642742842943043114 unmodified lines446447448449450451452168 unmodified lines62162262362462562662762862963063163263363463563663768 unmodified lines70670770870971071145 unmodified lines7577587597607617623 unmodified lines76676776876977077177277332 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","繁中", "简中", "繁日", "简日", "日语", "日文", "外挂", "内封", "字幕",}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_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 linesr"^(?: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"CHS|CHT|BIG5|GB|JPN?|JPSC|JPTC|简[体體]?|繁[体體]?|简日双语|繁日双语|内封|外挂|MSubs?)$",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 linesdef episode_number(token: str) -> Optional[int]:clean = clean_bracket(token)if season_number(clean) is not None:return Noneif DIMENSION_RE.match(clean) or DATE_RE.match(clean) or HASH_RE.match(clean):43 unmodified linesdef is_special(token: str) -> bool:clean = clean_bracket(token)return bool(SPECIAL_RE.match(clean) or SPECIAL_SEARCH_RE.match(clean))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):number = episode_number(token)if number is None:continueclean = 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 linesscore += 4if token.startswith("[") or token.startswith("(") or token.startswith("【"):score += 3if idx > 0 and tokens[idx - 1] in {"-", "_", "|"}:score += 2if idx >= len(tokens) // 2:score += 136 unmodified linesreturn Truedef label_context_season_tokens(tokens: Sequence[str],categories: List[str],16 unmodified linescategories[idx] = "season"def repair_structured_bracket_title_aliases(tokens: Sequence[str],categories: List[str],32 unmodified linesdef embedded_bracket_episode(token: str) -> Optional[tuple[str, str, str]]:"""Split malformed tokens such as '[Group}Title[658]' into title + episode."""if episode_number(token) is not None:return Nonematch = re.match(r"^(?P<prefix>.+?)\[(?P<episode>\d{1,4}(?:v\d+)?)(?P<close>\])?$", token, re.I)6 unmodified linesclose = match.group("close") or ""if not clean_bracket(prefix):return Nonenumber = int(re.search(r"\d+", episode).group())if number == 0 or number > 2000:return None23 unmodified linescategories: Sequence[str],tokenizer: AnimeTokenizer,require_episode: bool = True,) -> Optional[dict]:expanded_tokens, expanded_categories = expand_tokens_and_categories(tokens, categories, tokenizer)14 unmodified lineslabels = assign_iob2(expanded_categories)if len(expanded_tokens) != len(labels):return Noneif not any(label.endswith("TITLE") for label in labels):return Noneif require_episode and not any(label.endswith("EPISODE") for label in labels):return None168 unmodified linescategories.append("source")title_allowed = Falsecontinueif is_special(token):categories.append("special")title_allowed = Falsecontinueif is_noise_bracket(token):categories.append("sep")continuecategories.append("title")seen_title = Truereturn finalize_weak_sample(tokens, categories, tokenizer, require_episode=False)def bracket_delimiters(token: str) -> tuple[str, str]:68 unmodified linesexpanded_tokens.extend([match.group(1), match.group(2)])expanded_categories.extend(["season", "episode"])continueif category in {"group", "title"} and (token.startswith("[") or token.startswith("(") or token.startswith("【") or token.startswith("《")):45 unmodified linescategories[idx] = "resolution"elif is_source(token):categories[idx] = "source"elif is_special(token):categories[idx] = "special"elif is_explicit_season(token):3 unmodified linesepisode_idx = find_episode_index(tokens)if episode_idx is None:return fallback_embedded_episode_sample(tokens, tokenizer) or fallback_no_episode_sample(tokens, tokenizer)categories[episode_idx] = "episode"label_context_season_tokens(tokens, categories, episode_idx)repair_structured_bracket_title_aliases(tokens, categories, episode_idx)32 unmodified lines333435363738391 unmodified line41424344454647484950515253545556575825 unmodified lines8485868788899091929394959697989967 unmodified lines16716816917017117217317443 unmodified lines21821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036165 unmodified lines4274284294304314324334344354364374384394 unmodified lines44444544644744844945045136 unmodified lines48848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054116 unmodified lines55855956056156256356456556656756856957057157257357457557657757857958058158258358432 unmodified lines6176186196206216226236246256266276286296306316 unmodified lines63863964064164264364464523 unmodified lines66967067167267367467514 unmodified lines690691692693694695696168 unmodified lines86586686786886987087187287387487587687787887988088188288388488588688788888989089189289368 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\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 linesr"^(?: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 linesdef episode_number(token: str) -> Optional[int]:clean = clean_bracket(token)if SPECIAL_INDEX_RE.match(clean):return Noneif season_number(clean) is not None:return Noneif DIMENSION_RE.match(clean) or DATE_RE.match(clean) or HASH_RE.match(clean):43 unmodified linesdef is_special(token: str) -> bool:clean = clean_bracket(token)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 - 1while cursor >= 0:if not is_separator_token(tokens[cursor]):return cursorcursor -= 1return Nonedef next_significant_index(tokens: Sequence[str], idx: int) -> Optional[int]:cursor = idx + 1while cursor < len(tokens):if not is_separator_token(tokens[cursor]):return cursorcursor += 1return Nonedef previous_non_space_index(tokens: Sequence[str], idx: int) -> Optional[int]:cursor = idx - 1while cursor >= 0:if tokens[cursor].strip():return cursorcursor -= 1return Nonedef 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 Falseprev_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 Falseprev_idx = previous_significant_index(tokens, idx)if prev_idx is None:return Falseif is_special_index_continuation(tokens, prev_idx):return Trueif SPECIAL_INDEX_RE.match(clean_bracket(tokens[prev_idx])):return Truereturn Falsedef 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 Falseprev_idx = idx - 1 if idx > 0 else Nonenext_idx = idx + 1 if idx + 1 < len(tokens) else Noneprev_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 Trueif prev_clean == "ma" and next_clean == "p":return Trueif prev_clean in {"aac", "flac", "dts", "ddp", "ac3", "mp"} and next_clean == ".":return Trueif prev_clean == ".":prev_prev = clean_bracket(tokens[idx - 2]).lower() if idx >= 2 else ""if re.fullmatch(r"\d+", prev_prev):return Truereturn Falsedef 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 Falseprev_idx = previous_significant_index(tokens, idx)if prev_idx is None:return Falseif is_special_index_base(tokens[prev_idx]):return Trueprev_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 Trueif re.match(r"^\d{1,4}(?:v\d+|END)$", clean, re.I):return Trueif has_wrapping_brackets(tokens[idx]):return Trueprev_idx = previous_non_space_index(tokens, idx)if prev_idx is not None and tokens[prev_idx] in {"-", "_", "|"}:return Trueif idx > 0 and tokens[idx - 1] == "#":return Trueif number >= 100:return Truenext_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 Falseif tokens[prev_idx] in {"-", "_", "|"}:return Trueif has_wrapping_brackets(tokens[idx]):return Truereturn Falsedef 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):continuenumber = episode_number(token)if number is None:continueif not is_structural_episode_candidate(tokens, idx, number):continueclean = 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 linesscore += 4if token.startswith("[") or token.startswith("(") or token.startswith("【"):score += 3prev_idx = previous_non_space_index(tokens, idx)if prev_idx is not None and tokens[prev_idx] in {"-", "_", "|"}:score += 2if idx >= len(tokens) // 2:score += 136 unmodified linesreturn Truedef split_special_composite(clean: str) -> Optional[tuple[str, Optional[str]]]:match = SPECIAL_COMPOSITE_RE.fullmatch(clean)if not match:return Nonereturn 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 = compositeopen_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, catsdef clear_trailing_title_separators(tokens: Sequence[str], categories: List[str]) -> None:idx = len(categories) - 1while idx >= 0 and is_separator_token(tokens[idx]) and categories[idx] == "title":categories[idx] = "sep"idx -= 1def label_context_season_tokens(tokens: Sequence[str],categories: List[str],16 unmodified linescategories[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 = 0while idx < len(tokens):if not is_special_index_base(tokens[idx]):idx += 1continuenext_idx = next_significant_index(tokens, idx)if next_idx is None or not is_special_index_continuation(tokens, next_idx):idx += 1continuecategories[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 + 1def repair_structured_bracket_title_aliases(tokens: Sequence[str],categories: List[str],32 unmodified linesdef 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 Noneif 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 Noneif episode_number(token) is not None:return Nonematch = re.match(r"^(?P<prefix>.+?)\[(?P<episode>\d{1,4}(?:v\d+)?)(?P<close>\])?$", token, re.I)6 unmodified linesclose = match.group("close") or ""if not clean_bracket(prefix):return Noneif SPECIAL_INDEX_BASE_RE.match(clean_bracket(prefix)):return Nonenumber = int(re.search(r"\d+", episode).group())if number == 0 or number > 2000:return None23 unmodified linescategories: 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 lineslabels = assign_iob2(expanded_categories)if len(expanded_tokens) != len(labels):return Noneif require_title and not any(label.endswith("TITLE") for label in labels):return Noneif require_episode and not any(label.endswith("EPISODE") for label in labels):return None168 unmodified linescategories.append("source")title_allowed = Falsecontinueif is_special_index_sequence_token(tokens, idx) or is_special(token):clear_trailing_title_separators(tokens, categories)categories.append("special")title_allowed = Falsecontinueif is_noise_bracket(token):categories.append("sep")continueif seen_title and not title_allowed:categories.append("sep")continuecategories.append("title")seen_title = Truelabel_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 linesexpanded_tokens.extend([match.group(1), match.group(2)])expanded_categories.extend(["season", "episode"])continueif 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)continueif category in {"group", "title"} and (token.startswith("[") or token.startswith("(") or token.startswith("【") or token.startswith("《")):45 unmodified linescategories[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 linesepisode_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 lines891011127 unmodified lines128,15],"max_abs_diff": 5.65648078918457e-05}7 unmodified lines891011127 unmodified lines128,15],"max_abs_diff": 2.6702880859375e-05}
123version https://git-lfs.github.com/spec/v1oid sha256:6d967c5c2305e6737c9e791956a174655deebef2cfa477e081890ebddd56e004size 19633926123version https://git-lfs.github.com/spec/v1oid sha256:28ac9b1e17d0e70f31a986a1d677513d97e77748ccdf96c8d77245cadc54fa4esize 19652184
269 unmodified lines2702712722732742752764 unmodified lines28128228328428528640 unmodified lines32732832933033133233352 unmodified lines38638738838939039139239339439549 unmodified lines4454464474484494504514524534544554564574584594604614628 unmodified lines47147247347447547629 unmodified lines50650750850951051139 unmodified lines5515525535545555569 unmodified lines56656756856957057157257357457586 unmodified lines66266366466566666766866967067167267367411 unmodified lines68668768868969069169269369467 unmodified lines762763764765766767768269 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"CHS|CHT|GB|BIG5|JPN?|繁中|简中")SOURCE_RE = re.compile(rf"\b(?:{SOURCE_TOKEN_PATTERN})\b", re.I)SOURCE_TAG_RE = re.compile(4 unmodified linesr"^(?:檢索|检索|搜索|搜寻|搜尋|别名|別名|alias|search|keyword)\s*[::].+",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|繁中|简中|内封|外挂)$",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 linesor SOURCE_TAG_RE.fullmatch(clean)or SOURCE_RE.search(clean)or SPECIAL_TAG_RE.search(clean)or NOISE_META_RE.search(clean))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 linessource_matches = source_candidates(filename)current_source = repaired.get("source")preferred_source = source_matches[0] if source_matches else Noneif source_matches and (not current_sourceor not SOURCE_RE.fullmatch(str(current_source))or len(str(current_source)) <= 3 and str(current_source).lower() not in {"nf", "cr"}or (preferred_sourceand 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"})):repaired["source"] = preferred_sourceif not repaired.get("special"):for text, _start, _end in brackets:clean = text.strip()8 unmodified lines):repaired["episode"] = episodeif repaired.get("season") is None:match = SEASON_RE.search(filename)if match:29 unmodified linesif repaired.get("title") and repaired.get("season") is not None:repaired["title"] = strip_trailing_season_from_title(repaired["title"], repaired["season"])return repaired39 unmodified linesif marker.lower() == "ni" and "Kakuriyo no Yadomeshi Ni" not in prefix:continuereturn marker, valuereturn None9 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):return 90if any(part in {"web-dl", "webdl", "webrip", "web-rip", "bdrip", "bluray", "bdmv", "bd", "dvdrip", "dvd", "tvrip", "hdtv"} for part in parts):return 60if len(parts) > 1:return 40return 2086 unmodified linesep = int(ep_text)if ep == 0 or ep > 2000:continuecontext = filename[max(0, match.start() - 5):match.end() + 5]if RESOLUTION_RE.search(context) or re.search(r"AAC|DDP|AC3|H\.?26[45]|x26[45]", context, re.I):continuepriority = priorities[name]if 1 <= ep <= 200:priority += 20candidates.append((priority, match.start(), ep))if not candidates:return Nonereturn max(candidates, key=lambda item: (item[0], item[1]))[2]11 unmodified linesrf"(?:^|[\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))def strip_trailing_season_from_title(title: str, season: int) -> str:67 unmodified linesfor text, bracket_start, _bracket_end in bracket_parts(filename):if bracket_start <= start:continueif NOISE_META_RE.search(text) or RESOLUTION_RE.search(text) or SOURCE_RE.search(text):end = bracket_startbreak269 unmodified lines2702712722732742752762772784 unmodified lines28328428528628728828929029129229329429529629729840 unmodified lines33934034134234334434534652 unmodified lines39940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949 unmodified lines5395405415425435445455465475485495505515525535545555565575585595605618 unmodified lines57057157257357457557657757857958029 unmodified lines61061161261361461561661761861962062139 unmodified lines6616626636646656666676686696709 unmodified lines68068168268368468568668768868969069186 unmodified lines77877978078178278378478578678778878979079179279379479579679779879980080180280380480580680711 unmodified lines81982082182282382482582682767 unmodified lines895896897898899900901902903904905906907269 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?|JPSC|JPTC|繁中|简中")SOURCE_RE = re.compile(rf"\b(?:{SOURCE_TOKEN_PATTERN})\b", re.I)SOURCE_TAG_RE = re.compile(4 unmodified linesr"^(?:檢索|检索|搜索|搜寻|搜尋|别名|別名|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|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 linesor 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:continueseen.add(key)deduped.append((value, start, end))return dedupeddef 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 = filenamefor _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) == episodedef episode_comes_only_from_special_code(filename: str, episode: Optional[int]) -> bool:if episode is None:return Falsespecials = special_code_spans(filename)if not specials:return Falseep_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 Falsedef 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:breakcleaned = next_cleanedcleaned = 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 titledef 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 linessource_matches = source_candidates(filename)current_source = repaired.get("source")preferred_source = source_matches[0] if source_matches else Noneif preferred_source and (not current_sourceor source_priority(preferred_source) > source_priority(str(current_source))or (source_priority(preferred_source) == source_priority(str(current_source))and preferred_source.lower() != str(current_source).lower())):repaired["source"] = preferred_sourcespecial_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_specialif not repaired.get("special"):for text, _start, _end in brackets:clean = text.strip()8 unmodified lines):repaired["episode"] = episodeif repaired.get("episode") is not None and not plausible_episode_context(filename, int(repaired["episode"])):repaired["episode"] = episodeif episode_comes_only_from_special_code(filename, repaired.get("episode")):repaired["episode"] = Noneif repaired.get("season") is None:match = SEASON_RE.search(filename)if match:29 unmodified linesif 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_titleif repaired.get("title"):repaired["title"] = strip_title_special_codes(repaired["title"], repaired.get("special"))return repaired39 unmodified linesif marker.lower() == "ni" and "Kakuriyo no Yadomeshi Ni" not in prefix:continuereturn marker, valuenumeric_tail = re.search(r"(?:^|[\s._-])(?P<season>[2-9])$", prefix)if numeric_tail:return numeric_tail.group("season"), int(numeric_tail.group("season"))return None9 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", "web-dl", "webdl", "webrip", "web-rip", "bdrip", "bluray", "bdmv", "bd", "dvdrip", "dvd", "tvrip", "hdtv"} for part in parts):return 90if any(part in {"chs", "cht", "gb", "big5", "jpn", "jpsc", "jptc", "繁中", "简中"} for part in parts):return 70if 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 20if len(parts) > 1:return 40return 2086 unmodified linesep = int(ep_text)if ep == 0 or ep > 2000:continueep_start = match.start("ep")ep_end = match.end("ep")if span_is_inside_special_code(filename, ep_start, ep_end):continueif name == "generic_episode":tail = filename[ep_end:]if re.match(r"[-_][A-Za-z]", tail):continueif 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,):continuecontext = 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):continuepriority = priorities[name]if 1 <= ep <= 200:priority += 20candidates.append((priority, ep_start, ep))if not candidates:return Nonereturn max(candidates, key=lambda item: (item[0], item[1]))[2]11 unmodified linesrf"(?:^|[\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))",]if any(re.search(pattern, filename, re.I) for pattern in patterns):return Truereturn 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 linesfor text, bracket_start, _bracket_end in bracket_parts(filename):if bracket_start <= start:continueif (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_startbreak
116 unmodified lines117118119120121122250 unmodified lines373374375376377378379116 unmodified linesr"^(?:檢索|检索|搜索|搜寻|搜尋|别名|別名|alias|search|keyword)\s*[::].+",re.I,)READING_MARKER_RE = re.compile(r"(?<![A-Za-z0-9])"250 unmodified linesif not clean:continueif SPECIAL_TAG_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))116 unmodified lines117118119120121122123124125126250 unmodified lines377378379380381382383116 unmodified linesr"^(?:檢索|检索|搜索|搜寻|搜尋|别名|別名|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 linesif not clean:continueif 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))
123version https://git-lfs.github.com/spec/v1oid sha256:347b2f619fd63a71804c4742a069b20acd0cde870fc03cc2ac0f175b06586b72size 19142604123version https://git-lfs.github.com/spec/v1oid sha256:9f251f8d4bbb750ba3bfd6fceffbec32eff3f32e9f07820bdab48294052d15a5size 19142604
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563{"sample_count": 2048,"field_accuracy": {"group": 0.99951171875,"title": 0.99755859375,"season": 0.99609375,"episode": 0.998046875,"resolution": 1.0,"source": 0.99853515625,"special": 0.9990234375},"field_correct": {"group": 2047,"title": 2043,"season": 2040,"episode": 2044,"resolution": 2048,"source": 2045,"special": 2046},"field_total": {"group": 2048,"title": 2048,"season": 2048,"episode": 2048,"resolution": 2048,"source": 2048,"special": 2048},"full_match_accuracy": 0.99072265625,"full_match_correct": 2029,"full_match_total": 2048,"failures": [{"filename": "[ig]Itai no wa Iya nano de Bougyoryoku ni Kyokufuri Shitai to Omoimasu[WebRip 1920x1080 AVC YUV420 8Bit 1080p AAC].03.TC","errors": {"episode": {"gold": "3","pred": null}},"gold": {"group": "ig","title": "Itai no wa Iya nano de Bougyoryoku ni Kyokufuri Shitai to Omoimasu","season": null,"episode": 3,"resolution": "1080p","source": "WebRip","special": null},"pred": {"group": "ig","title": "Itai no wa Iya nano de Bougyoryoku ni Kyokufuri Shitai to Omoimasu","season": null,"episode": null,"resolution": "1080p","source": "WebRip","special": null}},{"filename": "[YYDM-11FANS][Nanana's Buried Treasure][preview][09][BDrip][720P][X264-10bit_AAC][34D29ED6]","errors": {"special": {"gold": "ed","pred": null}},"gold": {"group": "YYDM-11FANS","title": "Nanana's Buried Treasure","season": null,"episode": 9,"resolution": "720P","source": "BDrip","special": "ED"},"pred": {"group": "YYDM-11FANS","title": "Nanana's Buried Treasure","season": null,"episode": 9,"resolution": "720P","source": "BDrip","special": null}},{"filename": "[Moozzi2] Madou King Granzort Saigo no Magical Taisen OVA - 01 [ 1990 ] (BD 1440x1080 x.264 Flac)","errors": {"title": {"gold": "madou king granzort saigo no magical taisen ova","pred": "madou king granzort saigo no magical taisen ova - 01 [ 1990"},"episode": {"gold": "1","pred": "1990"}},"gold": {"group": "Moozzi2","title": "Madou King Granzort Saigo no Magical Taisen OVA","season": null,"episode": 1,"resolution": "1440x1080","source": "BD","special": "OVA"},"pred": {"group": "Moozzi2","title": "Madou King Granzort Saigo no Magical Taisen OVA - 01 [ 1990 ","season": null,"episode": 1990,"resolution": "1440x1080","source": "BD","special": "OVA"}},{"filename": "[64bitsub][Tensui no Sakuna-hime][08][BDRIP_1920x1080][AVC_FLAC_SUP]","errors": {"source": {"gold": "flac","pred": "avc-flac"}},"gold": {"group": "64bitsub","title": "Tensui no Sakuna-hime","season": null,"episode": 8,"resolution": "1920x1080","source": "FLAC","special": null},"pred": {"group": "64bitsub","title": "Tensui no Sakuna-hime","season": null,"episode": 8,"resolution": "1920x1080","source": "AVC_FLAC","special": null}},{"filename": "[VCB-Studio] Shingeki no Kyojin Movie 3 Kakusei no Houkou [Teaser_S3][Ma10p_1080p][x265_flac]","errors": {"season": {"gold": null,"pred": "3"}},"gold": {"group": "VCB-Studio","title": "Shingeki no Kyojin Movie 3 Kakusei no Houkou [Teaser_S3","season": null,"episode": 3,"resolution": "1080p","source": "x265_flac","special": "Movie"},"pred": {"group": "VCB-Studio","title": "Shingeki no Kyojin Movie 3 Kakusei no Houkou [Teaser_S3","season": 3,"episode": 3,"resolution": "1080p","source": "x265_flac","special": "Movie"}},{"filename": "FF:U ファイナルファンタジー:アンリミテッド ~異界の章~ #15 「ジェーン~うごきだすうみパズル」(DVD 640x480 DivX5 QB98 120fps lameVBR)[CRC_5FA44899]","errors": {"source": {"gold": "cr","pred": "dvd"}},"gold": {"group": null,"title": "FF:U ファイナルファンタジー:アンリミテッド ~異界の章~","season": null,"episode": 15,"resolution": "640x480","source": "CR","special": null},"pred": {"group": null,"title": "FF:U ファイナルファンタジー:アンリミテッド ~異界の章~","season": null,"episode": 15,"resolution": "640x480","source": "DVD","special": null}},{"filename": "[OVA]GALLFORCE ガルフォース2 宇宙章 vol2 [DESTRUCTION]","errors": {"title": {"gold": "gallforce ガルフォース2 宇宙章 vol","pred": "gallforce ガルフォース2 宇宙"}},"gold": {"group": "OVA","title": "GALLFORCE ガルフォース2 宇宙章 vol","season": null,"episode": 2,"resolution": null,"source": null,"special": "OVA"},"pred": {"group": "OVA","title": "GALLFORCE ガルフォース2 宇宙","season": null,"episode": 2,"resolution": null,"source": null,"special": "OVA"}},{"filename": "[病毒].[Fosky_Fansub][Virus_Buster_Serge][DVDrip][12][H264_AAC][640x480][GB&BIG5][F77551D0](ED2000.COM)","errors": {"special": {"gold": "ed","pred": "e"}},"gold": {"group": "病毒","title": "Fosky_Fansub","season": null,"episode": 12,"resolution": "640x480","source": "DVDrip","special": "ED"},"pred": {"group": "病毒","title": "Fosky_Fansub","season": null,"episode": 12,"resolution": "640x480","source": "DVDrip","special": "E"}},{"filename": "[DBD-Raws][Shadows House S1][Gekijou][18][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"season": {"gold": null,"pred": "1"}},"gold": {"group": "DBD-Raws","title": "Shadows House","season": null,"episode": 18,"resolution": "1080P","source": "BDRip","special": null},"pred": {"group": "DBD-Raws","title": "Shadows House","season": 1,"episode": 18,"resolution": "1080P","source": "BDRip","special": null}},{"filename": "Girls und Panzer - 10.5 (BD 1280x720 AVC AACx2)","errors": {"season": {"gold": "10","pred": "1"}},"gold": {"group": null,"title": "Girls und Panzer - 10.5","season": 10,"episode": 5,"resolution": "1280x720","source": "BD","special": null},"pred": {"group": null,"title": "Girls und Panzer - 10.5","season": 1,"episode": 5,"resolution": "1280x720","source": "BD","special": null}},{"filename": "[POPGO&SumiSora&TxxZ] Ginga Eiyuu Densetsu Die Neue These - Seiran 14 (BDRip 1080P X265 Main10p TrueHDX2 Chap)[A4E18C32]","errors": {"group": {"gold": null,"pred": "popgo&sumisora&txxz"},"title": {"gold": "popgo&sumisora&txxz","pred": "ginga eiyuu densetsu die neue these - seiran 14"}},"gold": {"group": null,"title": "POPGO&SumiSora&TxxZ","season": null,"episode": 14,"resolution": "1080P","source": "BDRip","special": null},"pred": {"group": "POPGO&SumiSora&TxxZ","title": "Ginga Eiyuu Densetsu Die Neue These - Seiran 14","season": null,"episode": 14,"resolution": "1080P","source": "BDRip","special": null}},{"filename": "[アニメ BD] Serial Experiments Lain 映像特典 「trailer 01」 (1440x1080 x264 AAC 2ch)","errors": {"title": {"gold": "serial experiments lain 映像特典 「trailer 01」","pred": "serial experiments lain 映像特典 「trailer"},"episode": {"gold": "2","pred": "1"}},"gold": {"group": "アニメ BD","title": "Serial Experiments Lain 映像特典 「trailer 01」","season": null,"episode": 2,"resolution": "1440x1080","source": "BD","special": null},"pred": {"group": "アニメ BD","title": "Serial Experiments Lain 映像特典 「trailer","season": null,"episode": 1,"resolution": "1440x1080","source": "BD","special": null}},{"filename": "[AJZ&BLU][God Eater][05][BIG5][v2] (2)","errors": {"episode": {"gold": "2","pred": "5"}},"gold": {"group": "AJZ&BLU","title": "God Eater","season": null,"episode": 2,"resolution": null,"source": "BIG5","special": null},"pred": {"group": "AJZ&BLU","title": "God Eater","season": null,"episode": 5,"resolution": null,"source": "BIG5","special": null}},{"filename": "(アニメ) YAT安心!宇宙旅行 第1期 第07話 「サバイバル!野生のカネア」 (LD 640x480 WMV9 QB90 24fps)","errors": {"season": {"gold": null,"pred": "1"}},"gold": {"group": "アニメ","title": "YAT安心!宇宙旅行","season": null,"episode": 7,"resolution": "640x480","source": null,"special": null},"pred": {"group": "アニメ","title": "YAT安心!宇宙旅行","season": 1,"episode": 7,"resolution": "640x480","source": null,"special": null}},{"filename": "Lord El-Melloi II-sei no Jikenbo 06 [1AAC021C]","errors": {"source": {"gold": "aac","pred": null}},"gold": {"group": null,"title": "Lord El-Melloi II-sei no Jikenbo","season": null,"episode": 6,"resolution": null,"source": "AAC","special": null},"pred": {"group": null,"title": "Lord El-Melloi II-sei no Jikenbo","season": null,"episode": 6,"resolution": null,"source": null,"special": null}},{"filename": "[Skymoon-Raws] Mashle 2nd Season - 01(13) [ViuTV][WEB-DL][1080p][AVC AAC]","errors": {"title": {"gold": "mashle 2nd season - 01","pred": "mashle 2nd season"},"season": {"gold": "2","pred": "1"}},"gold": {"group": "Skymoon-Raws","title": "Mashle 2nd Season - 01","season": 2,"episode": 13,"resolution": "1080p","source": "WEB-DL","special": null},"pred": {"group": "Skymoon-Raws","title": "Mashle 2nd Season","season": 1,"episode": 13,"resolution": "1080p","source": "WEB-DL","special": null}},{"filename": "【CXRAW】【S17】【Power Rangers RPM】【30】【End Game】【x264 Hi10p AAC】【MP4】","errors": {"season": {"gold": null,"pred": "17"}},"gold": {"group": "CXRAW","title": "S17","season": null,"episode": 30,"resolution": null,"source": "AAC","special": null},"pred": {"group": "CXRAW","title": "S17","season": 17,"episode": 30,"resolution": null,"source": "AAC","special": null}},{"filename": "(アニメ) YAT安心!宇宙旅行 第1期 第24話 「モーレツ!かあちゃん珍道中」 (LD 640x480 WMV9 QB90 24fps)","errors": {"season": {"gold": null,"pred": "1"}},"gold": {"group": "アニメ","title": "YAT安心!宇宙旅行","season": null,"episode": 24,"resolution": "640x480","source": null,"special": null},"pred": {"group": "アニメ","title": "YAT安心!宇宙旅行","season": 1,"episode": 24,"resolution": "640x480","source": null,"special": null}},{"filename": "[Snow-Raws] アイドルマスター シンデレラガールズ劇場 第2期 SP17 (DVD 1280x720 HEVC-YUV420P10 FLAC)","errors": {"season": {"gold": null,"pred": "2"}},"gold": {"group": "Snow-Raws","title": "アイドルマスター シンデレラガールズ劇場 第2期 SP17","season": null,"episode": 17,"resolution": "1280x720","source": "DVD","special": "SP"},"pred": {"group": "Snow-Raws","title": "アイドルマスター シンデレラガールズ劇場 第2期 SP17","season": 2,"episode": 17,"resolution": "1280x720","source": "DVD","special": "SP"}}]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582{"sample_count": 512,"field_accuracy": {"group": 1.0,"title": 0.974609375,"season": 0.98046875,"episode": 0.806640625,"resolution": 1.0,"source": 0.998046875,"special": 0.96875},"field_correct": {"group": 512,"title": 499,"season": 502,"episode": 413,"resolution": 512,"source": 511,"special": 496},"field_total": {"group": 512,"title": 512,"season": 512,"episode": 512,"resolution": 512,"source": 512,"special": 512},"full_match_accuracy": 0.751953125,"full_match_correct": 385,"full_match_total": 512,"failures": [{"filename": "[ReinForce] Sword Art Online II - ED3 (BDRip 1920x1080 x264 FLAC)","errors": {"season": {"gold": null,"pred": "2"}},"gold": {"group": "ReinForce","title": "Sword Art Online II","season": null,"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": "アニメ DVD","title": "銀装騎攻オーディアン ACT.06 特典映像 川田","season": null,"episode": null,"resolution": "640x480","source": "DVD","special": null}},{"filename": "05-ラディアン 第2シリーズ_ED","errors": {"title": {"gold": "05-ラディアン 第2シリーズ","pred": "05-ラディアン 第2"}},"gold": {"group": null,"title": "05-ラディアン 第2シリーズ","season": null,"episode": null,"resolution": null,"source": null,"special": "ED"},"pred": {"group": null,"title": "05-ラディアン 第2","season": null,"episode": null,"resolution": null,"source": null,"special": "ED"}},{"filename": "[A.A] hinotori 03","errors": {"title": {"gold": "hinotori 03","pred": "hinotori"},"episode": {"gold": null,"pred": "3"}},"gold": {"group": "A.A","title": "hinotori 03","season": null,"episode": null,"resolution": null,"source": null,"special": null},"pred": {"group": "A.A","title": "hinotori","season": null,"episode": 3,"resolution": null,"source": null,"special": null}},{"filename": "[Nekomoe kissaten] Azur Lane Bisoku Zenshin! [ED][05][BDRip 1080p HEVC-10bit FLAC]","errors": {"episode": {"gold": null,"pred": "5"}},"gold": {"group": "Nekomoe kissaten","title": "Azur Lane Bisoku Zenshin! [ED","season": null,"episode": null,"resolution": "1080p","source": "BDRip","special": "05"},"pred": {"group": "Nekomoe kissaten","title": "Azur Lane Bisoku Zenshin! [ED","season": null,"episode": 5,"resolution": "1080p","source": "BDRip","special": "05"}},{"filename": "[VCB-Studio] Danmachi IV [10][Ma10p_1080p][x265_flac]","errors": {"season": {"gold": null,"pred": "4"},"episode": {"gold": null,"pred": "10"}},"gold": {"group": "VCB-Studio","title": "Danmachi","season": null,"episode": null,"resolution": "1080p","source": "x265_flac","special": "10"},"pred": {"group": "VCB-Studio","title": "Danmachi","season": 4,"episode": 10,"resolution": "1080p","source": "x265_flac","special": "10"}},{"filename": "[FZSD&DBD-Raws][King of Prism Dramatic Prism.1][PV][12][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"episode": {"gold": null,"pred": "12"}},"gold": {"group": "FZSD&DBD-Raws","title": "King of Prism Dramatic Prism.1","season": null,"episode": null,"resolution": "1080P","source": "BDRip","special": "12"},"pred": {"group": "FZSD&DBD-Raws","title": "King of Prism Dramatic Prism.1","season": null,"episode": 12,"resolution": "1080P","source": "BDRip","special": "12"}},{"filename": "[SAIO-Raws] Wakaokami wa Shougakusei! PV 02 [BD 1920x1080 HEVC-10bit OPUS]","errors": {"episode": {"gold": null,"pred": "2"}},"gold": {"group": "SAIO-Raws","title": "Wakaokami wa Shougakusei! PV 02","season": null,"episode": null,"resolution": "1920x1080","source": "BD","special": "PV 02"},"pred": {"group": "SAIO-Raws","title": "Wakaokami wa Shougakusei! PV 02","season": null,"episode": 2,"resolution": "1920x1080","source": "BD","special": "PV 02"}},{"filename": "[DBD-Raws][Hime-sama Goumon no Jikan Desu][PV][01][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"episode": {"gold": null,"pred": "1"}},"gold": {"group": "DBD-Raws","title": "Hime-sama Goumon no Jikan Desu","season": null,"episode": null,"resolution": "1080P","source": "BDRip","special": "01"},"pred": {"group": "DBD-Raws","title": "Hime-sama Goumon no Jikan Desu","season": null,"episode": 1,"resolution": "1080P","source": "BDRip","special": "01"}},{"filename": "[DBD-Raws][Tenshi no 3P!][PV][03][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"episode": {"gold": null,"pred": "3"}},"gold": {"group": "DBD-Raws","title": "Tenshi no 3P!","season": null,"episode": null,"resolution": "1080P","source": "BDRip","special": "03"},"pred": {"group": "DBD-Raws","title": "Tenshi no 3P!","season": null,"episode": 3,"resolution": "1080P","source": "BDRip","special": "03"}},{"filename": "[Suzu-Kaze] DanMachi IV 21 [WebRip 1920x1080 HEVC YUV420P10 AAC]","errors": {"episode": {"gold": null,"pred": "21"}},"gold": {"group": "Suzu-Kaze","title": "DanMachi IV 21","season": null,"episode": null,"resolution": "1920x1080","source": "WebRip","special": "IV 21"},"pred": {"group": "Suzu-Kaze","title": "DanMachi IV 21","season": null,"episode": 21,"resolution": "1920x1080","source": "WebRip","special": "IV 21"}},{"filename": "[VCB-Studio] Log Horizon 2 [IV03][Ma10p_1080p][x265_aac]","errors": {"season": {"gold": null,"pred": "2"}},"gold": {"group": "VCB-Studio","title": "Log Horizon 2","season": null,"episode": null,"resolution": "1080p","source": "x265_aac","special": "IV03"},"pred": {"group": "VCB-Studio","title": "Log Horizon 2","season": 2,"episode": null,"resolution": "1080p","source": "x265_aac","special": "IV03"}},{"filename": "[DBD-Raws][Mahou Shoujo Lyrical Nanoha The Movie 2nd A's][PV][06][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"episode": {"gold": null,"pred": "6"}},"gold": {"group": "DBD-Raws","title": "Mahou Shoujo Lyrical Nanoha The Movie 2nd A's","season": null,"episode": null,"resolution": "1080P","source": "BDRip","special": "06"},"pred": {"group": "DBD-Raws","title": "Mahou Shoujo Lyrical Nanoha The Movie 2nd A's","season": null,"episode": 6,"resolution": "1080P","source": "BDRip","special": "06"}},{"filename": "[DBD-Raws][Hana wa Saku, Shura no Gotoku][PV][11][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"episode": {"gold": null,"pred": "11"}},"gold": {"group": "DBD-Raws","title": "Hana wa Saku, Shura no Gotoku","season": null,"episode": null,"resolution": "1080P","source": "BDRip","special": "11"},"pred": {"group": "DBD-Raws","title": "Hana wa Saku, Shura no Gotoku","season": null,"episode": 11,"resolution": "1080P","source": "BDRip","special": "11"}},{"filename": "[Seed-Raws] Strike the Blood IV - OVA Vol.01 Menu 02 (BD 1280x720 AVC AAC)","errors": {"season": {"gold": "4","pred": null}},"gold": {"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": "Seed-Raws","title": "Strike the Blood IV - OVA Vol.01 Menu 02","season": null,"episode": null,"resolution": "1280x720","source": "BD","special": "OVA"}},{"filename": "[DBD-Raws][Hametsu no Oukoku][PV][05][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"episode": {"gold": null,"pred": "5"}},"gold": {"group": "DBD-Raws","title": "Hametsu no Oukoku","season": null,"episode": null,"resolution": "1080P","source": "BDRip","special": "05"},"pred": {"group": "DBD-Raws","title": "Hametsu no Oukoku","season": null,"episode": 5,"resolution": "1080P","source": "BDRip","special": "05"}},{"filename": "[DBD-Raws][Tate no Yuusha no Nariagari S1][PV][03][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"episode": {"gold": null,"pred": "3"}},"gold": {"group": "DBD-Raws","title": "Tate no Yuusha no Nariagari","season": 1,"episode": null,"resolution": "1080P","source": "BDRip","special": "03"},"pred": {"group": "DBD-Raws","title": "Tate no Yuusha no Nariagari","season": 1,"episode": 3,"resolution": "1080P","source": "BDRip","special": "03"}},{"filename": "[DBD-Raws][Kimi no Iro][PV][12][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"episode": {"gold": null,"pred": "12"}},"gold": {"group": "DBD-Raws","title": "Kimi no Iro","season": null,"episode": null,"resolution": "1080P","source": "BDRip","special": "12"},"pred": {"group": "DBD-Raws","title": "Kimi no Iro","season": null,"episode": 12,"resolution": "1080P","source": "BDRip","special": "12"}},{"filename": "[DBD-Raws][Hime-sama Goumon no Jikan Desu][PV][02][1080P][BDRip][HEVC-10bit][FLAC]","errors": {"episode": {"gold": null,"pred": "2"}},"gold": {"group": "DBD-Raws","title": "Hime-sama Goumon no Jikan Desu","season": null,"episode": null,"resolution": "1080P","source": "BDRip","special": "02"},"pred": {"group": "DBD-Raws","title": "Hime-sama Goumon no Jikan Desu","season": null,"episode": 2,"resolution": "1080P","source": "BDRip","special": "02"}},{"filename": "Mahou.no.Angel.Sweet.Mint.TV.1990.DVDRip-Hi.x264.AC3.1024.EP21-nezumi","errors": {"title": {"gold": "mahou.no.angel.sweet.mint.tv.1990. -hi. .ac","pred": "mahou.no.angel.sweet.mint.tv.1 -h"}},"gold": {"group": null,"title": "Mahou.no.Angel.Sweet.Mint.TV.1990. -Hi. .AC","season": null,"episode": 21,"resolution": null,"source": "DVDRip","special": null},"pred": {"group": null,"title": "Mahou.no.Angel.Sweet.Mint.TV.1 -H","season": null,"episode": 21,"resolution": null,"source": "DVDRip","special": null}}]
1234562 unmodified lines91011121314151617181920212223{"experiment_name": "dmhy-char-guoman-relabel","data_file": "datasets/AnimeName/dmhy_weak_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,"gradient_accumulation_steps": 1,"dataloader_num_workers": 4}1234562 unmodified lines91011121314151617181920212223{"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": 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": 0}
1234567891011{"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}1234567891011{"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}
123version https://git-lfs.github.com/spec/v1oid sha256:f01503ec029ec161063c2d78a00732c80072525b8d258c7c717b2e21f4f55d93size 5265123version https://git-lfs.github.com/spec/v1oid sha256:b23b375ad7f991bc460e29c07b8250afa09ec2d62bad255e0fc6125f0982c56dsize 5265
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