Views
No views yet
Title [SEP] [abstract] Abstract text[section] Section text (no title prefix)1# Abstract with title
2text = "Smart thermostat system [SEP] [abstract] A thermostat system comprising..."
3
4# Claim without title
5text = "[claim] A method comprising: step 1, step 2..."1from transformers import AutoTokenizer, AutoModel
2import torch
3
4# Load model and tokenizer
5model_name = "ZoeYou/PatentMap-V0-SentShuffle"
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModel.from_pretrained(model_name)
8
9# Format patent text
10title = "Smart thermostat system"
11abstract = "A thermostat system comprising a temperature sensor..."
12patent_text = f"{title} [SEP] [abstract] {abstract}"
13
14# Encode and get embeddings
15inputs = tokenizer(patent_text, return_tensors="pt", padding=True, truncation=True, max_length=512)
16
17with torch.no_grad():
18 outputs = model(**inputs)
19 embeddings = outputs.last_hidden_state[:, 0, :] # CLS token
20
21print(embeddings.shape) # torch.Size([1, 1024])1@article{zuo2025patent,
2 title={Patent Representation Learning via Self-supervision},
3 author={Zuo, You and Gerdes, Kim and de La Clergerie, Eric Villemonte and Sagot, Beno{\^i}t},
4 journal={arXiv preprint arXiv:2511.10657},
5 year={2025}
6}