Views
No views yet
[CELL0]) / Boundary Marking (e.g., <E0>...)][CELL0] and [CELL1].<E0>...</E0> and <E1>...</E1>.1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4# 1. Load the model
5model_name = "mizuno-group/ccbert-[INSERT-CONFIG-NAME]"
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForSequenceClassification.from_pretrained(model_name)
8
9# 2. Prepare Input
10# CHANGE THIS LINE based on the Entity Indication method of this model:
11# text = "The [CELL0] activate [CELL1]." # If Replacement
12text = "The <E0> Macrophages </E0> activate <E1> T cells </E1>." # If Boundary Marking
13
14# 3. Inference
15inputs = tokenizer(text, return_tensors="pt")
16
17with torch.no_grad():
18 logits = model(**inputs).logits
19 predicted_class_id = logits.argmax().item()
20
21# 0 = No Relation, 1 = Relation Exists
22print(f"Predicted Class: {predicted_class_id}")
231@article{Yoshikawa2025CCBERT,
2 title = {Defining and Evaluating Cell–Cell Relation Extraction from Biomedical Literature under Realistic Annotation Constraints},
3 author = {Yoshikawa Mei and Mizuno Tadahaya and Ohto Yohei and Fujimoto Hiromi and Kusuhara Hiroyuki},
4 journal = {bioRxiv},
5 year = {2025},
6 doi = {10.64898/2025.12.01.691726},
7 url = {[https://doi.org/10.64898/2025.12.01.691726](https://doi.org/10.64898/2025.12.01.691726)}
8}
9