Downloads · 30 days
22
35% of all-time downloads
Tasfiya025/Multi-Label-Scientific-Abstract-Classifier
Multi-Label-Scientific-Abstract-Classifier is a machine learning model from Tasfiya025. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
SciAbstract-MultiLabel-BERT-Base is a specialized multi-label text classification model fine-tuned on scientific paper abstracts. It simultaneously classifies an abstract into its Primary Topic and determines the unde…
Downloads · 30 days
22
35% of all-time downloads
All-time downloads
62
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md3.7 KB · 52%
From the Hugging Face model README
SciAbstract-MultiLabel-BERT-Base is a specialized multi-label text classification model fine-tuned on scientific paper abstracts. It simultaneously classifies an abstract into its Primary Topic and determines the underlying Sentiment/Impact of the research findings (e.g., highly positive breakthrough, negative result/concern).
The model is based on the robust bert-base-uncased architecture and is ideal for automating the categorization and high-level assessment of large volumes of academic literature.
The model uses the BertForSequenceClassification head, configured for a multi-label setup.
bert-base-uncasedfrom transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
model_name = "Your-HF-Username/SciAbstract-MultiLabel-BERT-Base"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Sample abstract
abstract = "Development of a quantum entanglement system achieving coherence for over 10 seconds at room temperature, a significant breakthrough for quantum computing."
# Tokenize input
inputs = tokenizer(abstract, return_tensors="pt", truncation=True, padding=True)
# Make prediction
with torch.no_grad():
logits = model(**inputs).logits
# Apply sigmoid to get probabilities for each label
probabilities = torch.sigmoid(logits).squeeze()
# Get the label IDs and names
id2label = model.config.id2label
predicted_labels = [id2label[i] for i, prob in enumerate(probabilities) if prob > 0.5] # Threshold at 0.5
print(f"Abstract: {abstract}")
print("-" * 30)
print(f"Predicted Labels: {predicted_labels}")
# Expected Output Example: ['Topic: Physics', 'Sentiment: Highly Positive']