Views
No views yet
The_HeroThe_Wise_Old_ManThe_Great_MotherThe_Trickster| Base model | bert-base-uncased |
| Task | Multi-label classification |
| Max length | 256 tokens |
| Labels | 4 archetypes |
1import torch, json
2from transformers import BertTokenizer, BertForSequenceClassification
3from huggingface_hub import hf_hub_download
4
5REPO = "Aniruddhhhh/jungian-dream-archetype-group_2"
6tokenizer = BertTokenizer.from_pretrained(REPO)
7model = BertForSequenceClassification.from_pretrained(REPO)
8model.eval()
9
10arch_path = hf_hub_download(REPO, "archetypes.json")
11with open(arch_path) as f:
12 archetypes = json.load(f)
13
14dream = "I was chased through a dark forest by a shadowy figure."
15enc = tokenizer(dream, return_tensors="pt",
16 truncation=True, max_length=256)
17with torch.no_grad():
18 probs = torch.sigmoid(model(**enc).logits)[0]
19for arch, prob in zip(archetypes, probs):
20 print(f"{arch}: {prob:.3f}")