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
Verify low-frequency DMHY generated output
Browse filesFiles changed (2)
42 unmodified lines43444546474842 unmodified lines--threads 24```Optional controls:```powershell42 unmodified lines4344454647484950515253545556575842 unmodified lines--threads 24```Verify the generated training output has no low-frequency blocking warnings:```powershellcargo run --release --manifest-path tools\rust_dmhy_template_apply\Cargo.toml -- `--verify-generated-output `--input reports\dmhy_weak.template_generated.top5000.rust.jsonl `--recipes reports\dmhy_template_recipes.full_top5000.seed.jsonl `--audit-max-count 50```Optional controls:```powershell
18 unmodified lines19202122232467 unmodified lines92939495969798138 unmodified lines237238239240241242461 unmodified lines70470570670770870918 unmodified linescluster: bool,#[arg(long)]audit_low_frequency: bool,#[arg(long, default_value = "datasets/AnimeName/dmhy_list.jsonl")]input: PathBuf,#[arg(long, default_value = "reports/dmhy_template_recipes.seed.jsonl")]67 unmodified linescount: Option<u64>,}#[derive(Debug, Clone, Serialize)]struct Record {filename: String,tokens: Vec<String>,138 unmodified linesif args.audit_low_frequency {return run_low_frequency_audit(&args);}if args.expand != "all" && args.expand != "sample" {bail!("--expand must be all or sample");}461 unmodified linesOk(())}fn entity_spans(tokens: &[String], labels: &[String]) -> Vec<Value> {let mut spans = Vec::new();let mut current_label: Option<String> = None;18 unmodified lines192021222324252667 unmodified lines949596979899100138 unmodified lines239240241242243244245246247461 unmodified lines70971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478518 unmodified linescluster: bool,#[arg(long)]audit_low_frequency: bool,#[arg(long)]verify_generated_output: bool,#[arg(long, default_value = "datasets/AnimeName/dmhy_list.jsonl")]input: PathBuf,#[arg(long, default_value = "reports/dmhy_template_recipes.seed.jsonl")]67 unmodified linescount: Option<u64>,}#[derive(Debug, Clone, Serialize, Deserialize)]struct Record {filename: String,tokens: Vec<String>,138 unmodified linesif args.audit_low_frequency {return run_low_frequency_audit(&args);}if args.verify_generated_output {return run_verify_generated_output(&args);}if args.expand != "all" && args.expand != "sample" {bail!("--expand must be all or sample");}461 unmodified linesOk(())}fn run_verify_generated_output(args: &Args) -> Result<()> {let file = File::open(&args.input).with_context(|| format!("generated JSONL not found: {}", args.input.display()))?;let recipes_by_id: HashMap<String, u64> = load_recipes(args)?.into_values().map(|recipe| (recipe.template_id, recipe.count.unwrap_or(0))).collect();let mut rows = 0usize;let mut low_frequency_rows = 0usize;let mut warning_counts: HashMap<String, usize> = HashMap::new();let mut examples: HashMap<String, Vec<Value>> = HashMap::new();for (line_number, line) in BufReader::new(file).lines().enumerate() {let line = line?;if line.trim().is_empty() {continue;}let record: Record = serde_json::from_str(&line).with_context(|| {format!("invalid generated record at {}:{}",args.input.display(),line_number + 1)})?;rows += 1;let count = recipes_by_id.get(&record.template_id).copied().unwrap_or(u64::MAX);if count > args.audit_max_count {continue;}low_frequency_rows += 1;for warning in audit_warnings(&record) {if !matches!(warning.as_str(),"hash_labeled" | "multiple_title_spans" | "no_title" | "path_retained") {continue;}*warning_counts.entry(warning.clone()).or_default() += 1;let bucket = examples.entry(warning).or_default();if bucket.len() < 5 {bucket.push(json!({"template_id": record.template_id,"template_count": count,"filename": record.filename,"spans": entity_spans(&record.tokens, &record.labels),}));}}}let manifest = json!({"generated_at": Utc::now().to_rfc3339(),"input": args.input.to_string_lossy(),"recipes": args.recipes.to_string_lossy(),"audit_max_count": args.audit_max_count,"rows": rows,"low_frequency_rows": low_frequency_rows,"blocking_warning_counts": warning_counts,"examples": examples,"implementation": "rust_dmhy_generated_output_verify"});println!("{}", serde_json::to_string_pretty(&manifest)?);if !warning_counts.is_empty() {bail!("generated output still has low-frequency blocking warnings");}Ok(())}fn entity_spans(tokens: &[String], labels: &[String]) -> Vec<Value> {let mut spans = Vec::new();let mut current_label: Option<String> = None;
tools/rust_dmhy_template_apply/README.md+10
tools/rust_dmhy_template_apply/src/main.rs+77-1