CoolFace
Modelpublic

nasa-impact/sde-content-relevancy

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes8downloads
Model Card

Relevancy Classification Model

This is a single label classification task for automated relevancy tagging of documents in Science Discovery Engine. The idx to label mapping is:

"0": "Not Relevant",
"1": "Relevant",

Data distribution

Total data = 299k (106k relevant/193k non-relevant)

image/png

Evaluation of the model:

image/png

image/png

How to Use

You can load this model using the Hugging Face 🤗 Transformers library:

Using the Pipeline

python
from transformers import pipeline

classifier = pipeline("text-classification", model="nasa-impact/sde-content-relevancy")
prediction = classifier("Your input text", truncation=True, padding="max_length", max_length=512)
print(prediction)

Using the Model

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "nasa-impact/sde-content-relevancy"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

inputs = tokenizer("Your input text", return_tensors="pt", truncation=True, max_length=512, padding="max_length")
outputs = model(**inputs)
predicted_label = outputs.logits.argmax(-1).item()
print(predicted_label)