File size: 2,185 Bytes
053d3a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
56
57
58
59
60
61
62
---

language:
  - en
  - zh
  - de
  - es
  - fr
  - ja
library_name: pytorch
pipeline_tag: text-classification
base_model: google/embeddinggemma-300m
tags:
  - extreme-multi-label-classification
  - embeddinggemma
  - multilingual
---


# UserNeeds2K (FP16)

This standalone variant stores all weights in FP16. EmbeddingGemma computes in BF16 for numerical stability, while the classifier computes in FP16.

An extreme multi-label classifier for 2,000 categories (`Categoryv2-2000`, trained on `userneeds_samples_v3` and 2,000 encyclopedic domain overviews). Text is embedded with the bundled `google_embeddinggemma-300m` model; a 2,048-unit dynamic-negative MLP (`userneeds2k_dynamic_negative_mlp`) produces independent category scores. The package runs without downloading a separate embedding model.

## Usage

```bash

pip install -r requirements.txt

python example.py

```

Example output:

```text

0.6842  10004/20035/30200  Beauty & Fitness / Fitness / Fitness Instruction & Personal Training

0.5914  10004/20035/30203  Beauty & Fitness / Fitness / General Fitness

0.4418  10004/20035/31191  Beauty & Fitness / Fitness / Home Workouts, Bodyweight & Calisthenics

0.2875  10022/20214/30775  Reference / General Reference / How-To, DIY & Expert Content

0.1943  10004/20035/30202  Beauty & Fitness / Fitness / High Intensity Interval Training

```

## Supported language keys

| Key | Language |
|---|---|
| `cn` | Chinese |
| `en` | English |
| `de` | German |
| `sp` | Spanish |
| `fr` | French |
| `jp` | Japanese |

## Performance

| Test set | nDCG@5 | Precision@5 | Recall@5 | Top-1 hit | Tail recall@5 |
|---|---:|---:|---:|---:|---:|
| English | 0.803369 | 0.562866 | 0.758034 | 0.890662 | 0.584744 |
| Chinese | 0.756571 | 0.527800 | 0.716975 | 0.857000 | 0.503401 |

On an H100, this optimized FP16-storage variant processed 811.41 examples per second with 6952.34 MB peak GPU memory and achieved 0.756280 nDCG@5 on the 1,000-example precision comparison set.

No training records, translated samples, document embeddings, targets, split files, or training-derived document centroids are included in this package.