File size: 1,229 Bytes
23615dd
 
 
 
 
 
 
 
 
 
 
851d17f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Physics Topic Labeling
emoji: 🏢
colorFrom: pink
colorTo: yellow
sdk: gradio
sdk_version: 6.6.0
app_file: app.py
pinned: false
---

# PhySH Taxonomy Classifier — Gradio App

Interactive web app that predicts APS PhySH **disciplines** and **research-area concepts**
for a given paper title + abstract.

## How it works

1. Text is embedded with `google/embeddinggemma-300m` (768-dim, L2-normalised).
2. **Stage 1** — A multi-label MLP predicts discipline probabilities (18 classes).
3. **Stage 2** — A discipline-conditioned MLP concatenates the embedding with discipline
   probabilities and predicts research-area concepts (186 classes).

Both models are `.pt` checkpoints trained in `../0120_taxonomy_training_inference/`.

## Setup

The app uses the project-level virtualenv (`.venv` at the repo root).

```bash
# From the repo root
source .venv/bin/activate

# Install the one extra dependency
pip install gradio
```

## Run

```bash
cd 0219_gradio
python app.py
```

Then open `http://127.0.0.1:7860` in your browser.

## Model files

The app expects these checkpoints in the same directory as `app.py`:

- `discipline_classifier_gemma_20260130_140842.pt`
- `concept_conditioned_gemma_20260130_140842.pt`