AyoubChLin / distilbert_ag_cnn

huggingface.co
Total runs: 4
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: May 08 2023
text-classification

Introduction of distilbert_ag_cnn

Model Details of distilbert_ag_cnn

DistilBERT for MIX Dataset

This repository contains the code and pre-trained DistilBERT model for Multi-Industry Classification (MXC) Dataset. The model was fine-tuned for 4 epochs on a combination of AG News, CNN News, and 20 News Group (relabeled) datasets.

Model description

DistilBERT is a smaller and faster version of BERT, a state-of-the-art language model developed by Google. DistilBERT has the same architecture as BERT, but with fewer layers and fewer parameters. This makes it much faster and easier to deploy in production environments.

The pre-trained DistilBERT model was fine-tuned on the MIC dataset, which consists of news articles from three different industries: finance, technology, and sports. The task is to classify each article into one of these three categories.

Requirements
  • Python 3.x
  • PyTorch 1.8 or later
  • Transformers 4.0 or later
  • Pandas
  • NumPy
Evaluation

The model was evaluated on two different datasets: AG News and CNN News. Here are the evaluation results:

AG News
  • Loss: 0.16675
  • Accuracy: 0.94815789
  • Precision: 0.9483508
  • Recall: 0.94815789
  • F1 score: 0.9482136
CNN News
  • Loss: 0.119858004
  • Accuracy: 0.963338028
  • Precision: 0.96379391
  • Recall: 0.963338028
  • F1 score: 0.963524631
Usage

You can use the pre-trained model to make predictions on new news articles. Here's an example:

from transformers import AutoTokenizer, DistilBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("AyoubChLin/distilbert_ag_cnn")
model = DistilBertForSequenceClassification.from_pretrained("AyoubChLin/distilbert_ag_cnn")

# Replace "input_text" with the actual news article
input_text = "The stock market had a strong performance today, driven by strong earnings reports from technology companies."

# Tokenize the input text
inputs = tokenizer(input_text, return_tensors='pt')

# Make a prediction
outputs = model(**inputs)
predicted_label = torch.argmax(outputs.logits, dim=1)

# Print the predicted label
print(predicted_label)
Credits

Runs of AyoubChLin distilbert_ag_cnn on huggingface.co

4
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About distilbert_ag_cnn huggingface.co Model

More distilbert_ag_cnn license Visit here:

https://choosealicense.com/licenses/apache-2.0

distilbert_ag_cnn huggingface.co

distilbert_ag_cnn huggingface.co is an AI model on huggingface.co that provides distilbert_ag_cnn's model effect (), which can be used instantly with this AyoubChLin distilbert_ag_cnn model. huggingface.co supports a free trial of the distilbert_ag_cnn model, and also provides paid use of the distilbert_ag_cnn. Support call distilbert_ag_cnn model through api, including Node.js, Python, http.

distilbert_ag_cnn huggingface.co Url

https://huggingface.co/AyoubChLin/distilbert_ag_cnn

AyoubChLin distilbert_ag_cnn online free

distilbert_ag_cnn huggingface.co is an online trial and call api platform, which integrates distilbert_ag_cnn's modeling effects, including api services, and provides a free online trial of distilbert_ag_cnn, you can try distilbert_ag_cnn online for free by clicking the link below.

AyoubChLin distilbert_ag_cnn online free url in huggingface.co:

https://huggingface.co/AyoubChLin/distilbert_ag_cnn

distilbert_ag_cnn install

distilbert_ag_cnn is an open source model from GitHub that offers a free installation service, and any user can find distilbert_ag_cnn on GitHub to install. At the same time, huggingface.co provides the effect of distilbert_ag_cnn install, users can directly use distilbert_ag_cnn installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

distilbert_ag_cnn install url in huggingface.co:

https://huggingface.co/AyoubChLin/distilbert_ag_cnn

Url of distilbert_ag_cnn

distilbert_ag_cnn huggingface.co Url

Provider of distilbert_ag_cnn huggingface.co

AyoubChLin
ORGANIZATIONS

Other API from AyoubChLin

huggingface.co

Total runs: 14
Run Growth: 3
Growth Rate: 23.08%
Updated:January 25 2024