CoolFace
Modelpublic

DimitriosPanagoulias/MemoryBERT

sourceHugging Facemitupdated 1y agoView on Hugging Face
1likes5downloads
Model Card

🧠 About NOETIV

This project is part of the NOETIV initiative β€” a modular AI platform for healthcare proffesionals. πŸ”— Visit us at noetiv.com

🧠 MemoryBERT

A RoBERTa-based transformer model for Cognitive Memory Recognition (CMR) – classifying natural language into six memory categories inspired by cognitive science.


🧭 Overview

MemoryBERT is fine-tuned to classify user-generated text into:

  • β€”Episodic memory
  • β€”Semantic memory
  • β€”Spatial memory
  • β€”Emotional memory
  • β€”Associative memory
  • β€”Non-memory

This model supports research into memory-type classification, schema formation, and personalized AI interaction systems.

πŸ§ͺ Model Details

  • β€”Base model: roberta-base
  • β€”Task: Multi-class sequence classification
  • β€”Classes: 6
  • β€”Max sequence length: 128 tokens
  • β€”Training epochs: 1.5
  • β€”Label smoothing: 0.1
  • β€”Loss function: CrossEntropyLoss
  • β€”Optimizer: AdamW
  • β€”Batch size: 8

πŸ“Š Evaluation Results

On a synthetic 400-example test set balanced across classes:

ClassPrecisionRecallF1-scoreSupport
Associative1.001.001.0039
Emotional1.001.001.0040
Episodic1.001.001.0039
Non-memory1.001.001.00200
Semantic1.001.001.0040
Spatial1.001.001.0042
  • β€”Macro F1: 1.00
  • β€”Eval loss: 0.423
  • β€”Epochs: 1.5
  • β€”Accuracy: 100%
⚠️ 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

🧠 Dataset

MemoryBERT was trained on a synthetic dataset of 4,000 curated examples (2,000 memory and 2,000 non-memory)

Each entry is labeled with one of six memory types and tagged by domain and span group.


πŸš€ Usage

python
from transformers import RobertaTokenizer, RobertaForSequenceClassification

model = RobertaForSequenceClassification.from_pretrained("DimitriosPanagoulias/MemoryBERT")
tokenizer = RobertaTokenizer.from_pretrained("DimitriosPanagoulias/MemoryBERT")

def predict_memory_type(text):
    inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)
    outputs = model(**inputs)
    predicted_id = outputs.logits.argmax(dim=-1).item()
    return model.config.id2label[predicted_id]

predict_memory_type("Without a map, I navigated the winding back roads to reach my childhood home.")

or via huggingface pipeline

python
# Use a pipeline as a high-level helper
from transformers import pipeline
import torch
device = 0 if torch.cuda.is_available() else -1  # 0 = GPU, -1 = CPU
pipe = pipeline("text-classification", model="DimitriosPanagoulias/MemoryBERT", device=device)
pipe("I remember the long walk to my childhood school.")

outputs:

bash
[{'label': 'episodic', 'score': 0.9272529482841492}]

Authors

  • β€”Dimitrios P. Panagoulias, Department of Informatics, University of Piraeus
  • β€”Persephone Papatheodosiou, Sleep Research Unit, Department of Psychiatry, National and Kapodistrian University of Athens
  • β€”Anastasios Bonakis, Second Department of Neurology, National and Kapodistrian University of Athens
  • β€”Dimitris Dikeos, Sleep Research Unit, Department of Psychiatry, National and Kapodistrian University of Athens
  • β€”Maria Virvou, Lab of Software Engineering, Department of Informatics, University of Piraeus
  • β€”George A. Tsihrintzis, Lab of Pattern Recognition and Machine Learning – Multimedia Systems, Department of Informatics, University of Piraeus

Citation

You can cite either one or both of the following previous related work:

  • β€”Panagoulias, D.P. et al. β€œMemory and Schema in Human–Generative Artificial Intelligence Interactions.” 2024 IEEE ICTAI Conference (in press)

Available at: https://ieeexplore.ieee.org/document/10849404

  • β€”Panagoulias, D.P. et al. Mathematical representation of memory and schema for improving human-generative AI interactions.” 2024 IEEE IISA Conference (in press)

Available at: https://ieeexplore.ieee.org/document/10786703