File size: 1,078 Bytes
36a4452
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24d9691
 
 
 
 
 
36a4452
 
 
 
24d9691
 
 
36a4452
24d9691
36a4452
 
 
 
 
 
24d9691
36a4452
 
 
 
 
 
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
---
library_name: transformers.js
base_model: checkpoints/merged
tags:
  - onnx
  - transformers.js
  - script-parsing
  - rehearsay
pipeline_tag: text-generation
---

# Script Parser 360M (ONNX)

Fine-tuned SmolLM2-360M-Instruct for theatrical script parsing.
Converts raw script text into pipe-delimited `D|CHARACTER|parenthetical|line` and `S|stage direction` format.

## Usage with transformers.js

```javascript
import { AutoTokenizer, AutoModelForCausalLM } from "@huggingface/transformers";

const tokenizer = await AutoTokenizer.from_pretrained("frissonlabs/script-parser-360m-ONNX");
const model = await AutoModelForCausalLM.from_pretrained("frissonlabs/script-parser-360m-ONNX", {
    dtype: "q4f16",
    device: "wasm",  // or "webgpu"
});
```

## Input/Output Format

**Input** (raw script text):
```
JOHN. (Crossing to the window.) I can't believe you said that.
Mary. I didn't say anything!
(The phone rings.)
```

**Output** (pipe-delimited):
```
D|JOHN|Crossing to the window.|I can't believe you said that.
D|MARY||I didn't say anything!
S|The phone rings.
```