File size: 3,103 Bytes
c09231e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c24c85e
c09231e
 
 
 
 
 
 
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
license: mit
language:
- en
base_model:
- microsoft/BiomedNLP-BiomedBERT-base-uncased-abstract-fulltext
tags:
- biomedical
- relation-extraction
- text-classification
---

# cell-cell-BERT

**Configuration: R-pretrained**

This model includes learned embeddings for special tokens (e.g., [CELL0], [CELL1]), acquired through continued pre-training on biomedical text.

## Model Description

This is a specific configuration of the cell-cell-BERT model for extracting cell-cell interactions from biomedical text. It determines whether a sentence describes a direct biological relationship between two target cell types.

For full details, see our paper: **"Defining and Evaluating Cell–Cell Relation Extraction from Biomedical Literature under Realistic Annotation Constraints"** (bioRxiv, 2025).

* **Repository:** [https://github.com/mizuno-group/cell-cell-bert](https://github.com/mizuno-group/cell-cell-bert)
* **Paper:** [https://doi.org/10.64898/2025.12.01.691726](https://doi.org/10.64898/2025.12.01.691726)

## Model Configuration
This model corresponds to the following experimental setting in the paper:

* **Entity Indication:** [Replacement (e.g., `[CELL0]`) / Boundary Marking (e.g., `<E0>...`)]
* **Architecture:** [Entity-aware (R-BERT style) / CLS-only]
* **Pre-training:** [Continued Pre-training (CPT) / Base (Fine-tuning only)]

*Note: Please ensure your input data preprocessing matches the **Entity Indication** method specified above.*

## How to Get Started

**Preprocessing Requirement:**
Depending on the configuration above, you must insert specific special tokens into your input text before feeding it to the model.

* **For Replacement models:** Replace cell names with `[CELL0]` and `[CELL1]`.
* **For Boundary models:** Wrap cell names with `<E0>...</E0>` and `<E1>...</E1>`.

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

# 1. Load the model
model_name = "mizuno-group/ccbert-[INSERT-CONFIG-NAME]"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

# 2. Prepare Input
# CHANGE THIS LINE based on the Entity Indication method of this model:
# text = "The [CELL0] activate [CELL1]."  # If Replacement
text = "The <E0> Macrophages </E0> activate <E1> T cells </E1>." # If Boundary Marking

# 3. Inference
inputs = tokenizer(text, return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits
    predicted_class_id = logits.argmax().item()

# 0 = No Relation, 1 = Relation Exists
print(f"Predicted Class: {predicted_class_id}")

```

## Citation

```bibtex
@article{Yoshikawa2025CCBERT,
  title   = {Defining and Evaluating Cell–Cell Relation Extraction from Biomedical Literature under Realistic Annotation Constraints},
  author  = {Yoshikawa Mei and Mizuno Tadahaya and Ohto Yohei and Fujimoto Hiromi and Kusuhara Hiroyuki},
  journal = {bioRxiv},
  year    = {2025},
  doi     = {10.64898/2025.12.01.691726},
  url     = {[https://doi.org/10.64898/2025.12.01.691726](https://doi.org/10.64898/2025.12.01.691726)}
}

```