ZoeYou commited on
Commit
69a842e
Β·
verified Β·
1 Parent(s): b049ac4

Upload PatentBERT PyTorch model

Browse files

BERT model fine-tuned for patent classification, converted from TensorFlow to PyTorch.

Specifications:
- Format: SafeTensors
- Classes: Auto-detected from config.json
- Conversion: TensorFlow 1.15 β†’ PyTorch via transformers

Included files:
labels.json, README.md, tokenizer_config.json, vocab.txt, model.safetensors, config.json

Files changed (2) hide show
  1. README.md +4 -10
  2. config.json +2 -1
README.md CHANGED
@@ -1,13 +1,6 @@
1
- ---
2
- license: gpl-3.0
3
- language:
4
- - en
5
- base_model:
6
- - google-bert/bert-base-uncased
7
- ---
8
  # PatentBERT - PyTorch
9
 
10
- BERT model specialized for patent classification using the **CPC (Cooperative Patent Classification) system**. ([PatentBert](https://github.com/jiehsheng/PatentBERT) converted into PyTorch version)
11
 
12
  ## πŸ“Š Specifications
13
 
@@ -64,7 +57,7 @@ predicted_class_id = predictions.argmax().item()
64
  confidence = predictions.max().item()
65
 
66
  # Use model labels (real CPC codes)
67
- predicted_label = model.config.id2label[predicted_class_id]
68
 
69
  print(f"Predicted CPC class: {predicted_label} (ID: {predicted_class_id})")
70
  print(f"Confidence: {confidence:.2%}")
@@ -87,7 +80,8 @@ This model was trained on a large patent corpus to automatically classify docume
87
 
88
  - [Cooperative Patent Classification (CPC)](https://www.cooperativepatentclassification.org/)
89
  - [Original PatentBERT Paper](https://arxiv.org/abs/2103.02557)
 
90
 
91
  ## πŸ“ Citation
92
 
93
- If you use this model, please cite the original PatentBERT work and mention this PyTorch conversion.
 
 
 
 
 
 
 
 
1
  # PatentBERT - PyTorch
2
 
3
+ BERT model specialized for patent classification using the **real CPC (Cooperative Patent Classification) system** from the original PatentBERT training data.
4
 
5
  ## πŸ“Š Specifications
6
 
 
57
  confidence = predictions.max().item()
58
 
59
  # Use model labels (real CPC codes)
60
+ predicted_label = model.config.id2label[str(predicted_class_id)]
61
 
62
  print(f"Predicted CPC class: {predicted_label} (ID: {predicted_class_id})")
63
  print(f"Confidence: {confidence:.2%}")
 
80
 
81
  - [Cooperative Patent Classification (CPC)](https://www.cooperativepatentclassification.org/)
82
  - [Original PatentBERT Paper](https://arxiv.org/abs/2103.02557)
83
+ - [Hugging Face Transformers](https://huggingface.co/transformers/)
84
 
85
  ## πŸ“ Citation
86
 
87
+ If you use this model, please cite the original PatentBERT work and mention this PyTorch conversion.
config.json CHANGED
@@ -1336,5 +1336,6 @@
1336
  "transformers_version": "4.53.0",
1337
  "type_vocab_size": 2,
1338
  "use_cache": true,
1339
- "vocab_size": 30522
 
1340
  }
 
1336
  "transformers_version": "4.53.0",
1337
  "type_vocab_size": 2,
1338
  "use_cache": true,
1339
+ "vocab_size": 30522,
1340
+ "num_labels": 656
1341
  }