Downloads · 30 days
8
33% of all-time downloads
linh101201/scibert-concept-annotation
scibert-concept-annotation is a text classification model from linh101201. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of SciBERT for Concept Annotation. It classifies the relationship between a document text and a specific concept/term using sequence classification.
Downloads · 30 days
8
33% of all-time downloads
All-time downloads
24
Public
Parameters
110M
440 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors440 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of SciBERT for Concept Annotation. It classifies the relationship between a document text and a specific concept/term using sequence classification.
allenai/scibert_scivocab_uncasedYou can use this model directly with a custom inference script. Note that while the model weights are hosted here, it is designed to work with the allenai/scibert_scivocab_uncased tokenizer.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
# Load model and tokenizer
model_id = "linh101201/scibert-concept-annotation"
tokenizer_id = "allenai/scibert_scivocab_uncased"
model = AutoModelForSequenceClassification.from_pretrained(model_id, num_labels=2).to("cuda")
tokenizer = AutoTokenizer.from_pretrained(tokenizer_id)
# Example inputs: Document text and the Concept to annotate
text = "Large Language Model in Law Documents Hub"
concept = "natural language processing"
inputs = tokenizer(text, concept, return_tensors="pt").to("cuda")
with torch.no_grad():
logits = model(**inputs).logits
# Apply softmax to get probabilities
probs = torch.nn.functional.softmax(logits, dim=-1)
print(f"Logits: {logits}")
print(f"Probabilities: {probs}")