DimitriosPanagoulias commited on
Commit
21502be
·
verified ·
1 Parent(s): 326a27c

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 🧠 MemoryBERT
2
+
3
+ A RoBERTa-based transformer model for **Cognitive Memory Recognition (CMR)** – classifying natural language into six memory categories inspired by cognitive science.
4
+
5
+ ---
6
+
7
+ ## 🧭 Overview
8
+
9
+ MemoryBERT is fine-tuned to classify user-generated text into:
10
+ - **Episodic memory**
11
+ - **Semantic memory**
12
+ - **Spatial memory**
13
+ - **Emotional memory**
14
+ - **Associative memory**
15
+ - **Non-memory**
16
+
17
+ This model supports research into memory-type classification, schema formation, and personalized AI interaction systems.
18
+
19
+ ---
20
+
21
+ ## 🧪 Model Details
22
+
23
+ - **Base model**: `roberta-base`
24
+ - **Task**: Multi-class sequence classification
25
+ - **Classes**: 6
26
+ - **Max sequence length**: 128 tokens
27
+ - **Training epochs**: 1.5
28
+ - **Label smoothing**: 0.1
29
+ - **Loss function**: CrossEntropyLoss
30
+ - **Optimizer**: AdamW
31
+ - **Batch size**: 8
32
+
33
+ ---
34
+
35
+ ## 📊 Evaluation Results
36
+
37
+ On a synthetic 400-example test set balanced across classes:
38
+
39
+ | Class | Precision | Recall | F1-score | Support |
40
+ |---------------|-----------|--------|----------|---------|
41
+ | Associative | 1.00 | 1.00 | 1.00 | 39 |
42
+ | Emotional | 1.00 | 1.00 | 1.00 | 40 |
43
+ | Episodic | 1.00 | 1.00 | 1.00 | 39 |
44
+ | Non-memory | 1.00 | 1.00 | 1.00 | 200 |
45
+ | Semantic | 1.00 | 1.00 | 1.00 | 40 |
46
+ | Spatial | 1.00 | 1.00 | 1.00 | 42 |
47
+
48
+ - **Macro F1**: 1.00
49
+ - **Eval loss**: 0.423
50
+ - **Epochs**: 1.5
51
+ - **Accuracy**: 100%
52
+
53
+ > ⚠️ Note: These results are from a synthetic dataset — further real-world validation is ongoing and expansion of baseline dataset used for version 1 of memoryBERT
54
+
55
+ ---
56
+
57
+ ## 🧠 Dataset
58
+
59
+ MemoryBERT was trained on a synthetic dataset of 4,000 curated examples (2,000 memory and 2,000 non-memory)
60
+
61
+ Each entry is labeled with one of six memory types and tagged by domain and span group.
62
+
63
+ ---
64
+
65
+ ## 🚀 Usage
66
+
67
+ ```python
68
+ from transformers import RobertaTokenizer, RobertaForSequenceClassification
69
+
70
+ model = RobertaForSequenceClassification.from_pretrained("DimitriosPanagoulias/MemoryBERT")
71
+ tokenizer = RobertaTokenizer.from_pretrained("DimitriosPanagoulias/MemoryBERT")
72
+
73
+ def predict_memory_type(text):
74
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)
75
+ outputs = model(**inputs)
76
+ predicted_id = outputs.logits.argmax(dim=-1).item()
77
+ return model.config.id2label[predicted_id]
78
+
79
+ predict_memory_type("Without a map, I navigated the winding back roads to reach my childhood home.")
80
+ ```
81
+
82
+ ## Citation
83
+
84
+ You can cite either one or both of the following previous related work:
85
+
86
+ - Panagoulias, D.P. et al. “Memory and Schema in Human–Generative Artificial Intelligence Interactions.”
87
+ 2024 IEEE ICTAI Conference (in press)
88
+
89
+ - Panagoulias, D.P. et al. Mathematical representation of memory and schema for improving human-generative AI interactions.”
90
+ 2024 IEEE IISA Conference (in press)
config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "roberta-base",
3
+ "architectures": [
4
+ "RobertaForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "eos_token_id": 2,
10
+ "hidden_act": "gelu",
11
+ "hidden_dropout_prob": 0.1,
12
+ "hidden_size": 768,
13
+ "id2label": {
14
+ "0": "associative",
15
+ "1": "emotional",
16
+ "2": "episodic",
17
+ "3": "non_memory",
18
+ "4": "semantic",
19
+ "5": "spatial"
20
+ },
21
+ "initializer_range": 0.02,
22
+ "intermediate_size": 3072,
23
+ "label2id": {
24
+ "associative": 0,
25
+ "emotional": 1,
26
+ "episodic": 2,
27
+ "non_memory": 3,
28
+ "semantic": 4,
29
+ "spatial": 5
30
+ },
31
+ "layer_norm_eps": 1e-05,
32
+ "max_position_embeddings": 514,
33
+ "model_type": "roberta",
34
+ "num_attention_heads": 12,
35
+ "num_hidden_layers": 12,
36
+ "pad_token_id": 1,
37
+ "position_embedding_type": "absolute",
38
+ "torch_dtype": "float32",
39
+ "transformers_version": "4.40.1",
40
+ "type_vocab_size": 1,
41
+ "use_cache": true,
42
+ "vocab_size": 50265
43
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c30a3553436a20192f71a397eb36c69c96da5dee281cfa84076b494284821d62
3
+ size 498625128
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": true,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": true,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<pad>",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": true,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": true,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "50264": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": false,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ }
44
+ },
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": true,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "errors": "replace",
50
+ "mask_token": "<mask>",
51
+ "model_max_length": 512,
52
+ "pad_token": "<pad>",
53
+ "sep_token": "</s>",
54
+ "tokenizer_class": "RobertaTokenizer",
55
+ "unk_token": "<unk>"
56
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f6d562bc8eecf58632b0f7f99ba17ab5c0f68ac67bcff8fdbaba3d8d20350ea
3
+ size 5393
vocab.json ADDED
The diff for this file is too large to render. See raw diff