Run this model with HF Jobs

Run linh101201/scibert-concept-annotation on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/linh101201/scibert-concept-annotation. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/linh101201/scibert-concept-annotation on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

SciBERT Concept Annotation

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.

Model Description

  • Model type: SciBERT (BERT-based)
  • Language(s): English
  • License: Apache 2.0
  • Fine-tuned from model: allenai/scibert_scivocab_uncased

Usage

You 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.

Example Code

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}")
Downloads last month
23
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support