File size: 2,154 Bytes
361f3d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
tags:
  - filename-parsing
  - media-server
  - token-classification
license: mit
---

# lain-parser

Filename parser models for [Lain](https://github.com/enrell/lain), a self-hosted
media server. This repo is the distribution channel for the `lain-parser`
service: an immutable store of encoder snapshots and exported model artifacts,
plus the installer.

## Layout

- `manifest.json` — the release channel. `default` names the model new installs
  get; every entry carries sha256s, the encoder snapshot it pairs with, the
  decoder window and the eval summary.
- `models/<name>/` — one directory per released artifact: `model.int8.pt`
  (service artifact), `config.json`, `model.fpgw` + `model.fpgw.json` (the Go
  port format). Directories are immutable — an update adds a new directory and
  moves the `default` pointer, never rewrites a released file.
- `snapshots/<name>/` — the character-encoder snapshot a model was trained on
  (`anifilebert-dapt512-long`: AniFileBERT + 40 epochs of continued masked-LM on
  an unlabeled filename corpus).
- `install.sh`, `requirements.txt`, `app/` — the service installer and the
  vendored inference subset.

## Install / update

```sh
hf download Enrell/lain-parser --include "install.sh requirements.txt app/**" \
  --local-dir lain-parser
bash lain-parser/install.sh            # installs or updates to manifest default
bash lain-parser/install.sh --model e5-s2   # pin a specific version
```

The installer downloads the pinned snapshot + model, verifies every file's
sha256 against the manifest, test-parses before touching the running unit, then
restarts `lain-parser.service`. Old artifacts are left in place for rollback.
Source and full provenance:
[filename-parser](https://github.com/enrell/filename-parser) `packaging/lain-parser/`.

## Current model

`e5-s2` — span-head parser over a DAPT-512-long AniFileBERT encoder with Unicode
class features and a semi-CRF loss (28.5M params, 38 MiB int8). Development-grade
evaluation: 137/196 exact on a hash-locked real-name suite (+6.5 pp over the
previous recipe); 2 false emissions on 30 gold-abstain rows; ~54 ms/row on a
2-core CPU.