File size: 1,821 Bytes
91ad21d db7370e 82b4e1c db7370e 82b4e1c db7370e 1865799 db7370e 1865799 db7370e 82b4e1c db7370e 9e837ef db7370e 82b4e1c db7370e 82b4e1c db7370e 82b4e1c db7370e 82b4e1c db7370e 82b4e1c 91ad21d |
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 63 64 65 66 |
---
license: apache-2.0
datasets:
- 4nkh/theme_data
language:
- en
metrics:
- precision
- f1
- recall
- accuracy
base_model:
- google-bert/bert-base-uncased
pipeline_tag: text-classification
library_name: transformers
tags:
- multi-label
- theme_detection
- mentorship
- entrepreneurship
- startup success
- json automation
---
# Theme classification model (multi-label)
This repository contains a fine-tuned BERT model for classifying short texts into community-oriented themes. The model was trained locally and pushed to the Hugging Face Hub.
Model details
- Model architecture: bert-base-uncased (fine-tuned)
- Problem type: multi-label classification
- Labels: `mentorship`, `entrepreneurship`, `startup success`
- Training data: `train_theme.jsonl` (included)
- Final evaluation (example run):
- eval_loss: 0.1822
- eval_micro/f1: 1.0
- eval_macro/f1: 1.0
Usage
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
repo = "4nkh/theme_model"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo)
texts = ["Our co-op paired first-time founders with veteran shop owners to troubleshoot setbacks."]
inputs = tokenizer(texts, truncation=True, padding=True, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
probs = torch.sigmoid(logits)
preds = (probs >= 0.5).int()
print('probs', probs.numpy(), 'preds', preds.numpy())
```
Notes
- This model uses a threshold of 0.5 for multi-label predictions. Adjust thresholds per-class as needed.
- If you want to re-train or fine-tune further, see `train_theme_model.py` in this folder.
License
Specify your license here (e.g., Apache-2.0) or remove this section if you prefer a different license. |