This repository contains a DistilBERT model trained for zero-shot classification on CNN articles. The model has been evaluated on CNN articles and achieved an accuracy of 0.956 and an F1 score of 0.955.
Model Details
Architecture: DistilBERT
Training Data: CNN articles
Accuracy: 0.956
F1 Score: 0.955
Usage
To use this model for zero-shot classification, you can follow the steps below:
Load the trained model:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("AyoubChLin/DistilBERT_ZeroShot")
model = AutoModelForSequenceClassification.from_pretrained("AyoubChLin/DistilBERT_ZeroShot")
Classify text using zero-shot classification:
from transformers import pipeline
# Create a zero-shot classification pipeline
classifier = pipeline("zero-shot-classification", model=model, tokenizer=tokenizer)
# Classify a sentence
sentence = "The latest scientific breakthroughs in medicine"
candidate_labels = ["politics", "sports", "technology", "business"]
result = classifier(sentence, candidate_labels)
print(result)
The output will be a dictionary containing the classified label and the corresponding classification score.
About the Author
This work was created by Ayoub Cherguelaine.
If you have any questions or suggestions regarding this repository or the trained model, feel free to reach out to Ayoub Cherguelaine.
Runs of AyoubChLin DistilBERT_ZeroShot on huggingface.co
118
Total runs
4
24-hour runs
24
3-day runs
36
7-day runs
59
30-day runs
More Information About DistilBERT_ZeroShot huggingface.co Model
DistilBERT_ZeroShot huggingface.co is an AI model on huggingface.co that provides DistilBERT_ZeroShot's model effect (), which can be used instantly with this AyoubChLin DistilBERT_ZeroShot model. huggingface.co supports a free trial of the DistilBERT_ZeroShot model, and also provides paid use of the DistilBERT_ZeroShot. Support call DistilBERT_ZeroShot model through api, including Node.js, Python, http.
DistilBERT_ZeroShot huggingface.co is an online trial and call api platform, which integrates DistilBERT_ZeroShot's modeling effects, including api services, and provides a free online trial of DistilBERT_ZeroShot, you can try DistilBERT_ZeroShot online for free by clicking the link below.
AyoubChLin DistilBERT_ZeroShot online free url in huggingface.co:
DistilBERT_ZeroShot is an open source model from GitHub that offers a free installation service, and any user can find DistilBERT_ZeroShot on GitHub to install. At the same time, huggingface.co provides the effect of DistilBERT_ZeroShot install, users can directly use DistilBERT_ZeroShot installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
DistilBERT_ZeroShot install url in huggingface.co: