AyoubChLin / bert_cnn_news

huggingface.co
Total runs: 79
24-hour runs: 3
7-day runs: 65
30-day runs: 69
Model's Last Updated: Julio 12 2023
text-classification

Introduction of bert_cnn_news

Model Details of bert_cnn_news

BertForSequenceClassification on CNN News Dataset

This repository contains a fine-tuned Bert base model for sequence classification on the CNN News dataset. The model is able to classify news articles into one of six categories: business, entertainment, health, news, politics, and sport.

The model was fine-tuned for four epochs achieving a training loss of 0.077900, a validation loss of 0.190814

  • accuracy : 0.956690.
  • f1 : 0.956144.
  • precision : 0.956393
  • recall : 0.956690
Model Description
Usage

You can use this model with the Hugging Face Transformers library for a variety of natural language processing tasks, such as text classification, sentiment analysis, and more.

Here's an example of how to use this model for text classification in Python:

from transformers import AutoTokenizer, BertForSequenceClassification

model_name = "AyoubChLin/bert_cnn_news"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = TFAutoModelForSequenceClassification.from_pretrained(model_name)

text = "This is a news article about politics."
inputs = tokenizer(text, padding=True, truncation=True, return_tensors="tf")

outputs = model(inputs)
predicted_class_id = tf.argmax(outputs.logits, axis=-1).numpy()[0]

labels = ["business", "entertainment", "health", "news", "politics", "sport"]
predicted_label = labels[predicted_class_id]

In this example, we first load the tokenizer and the model using their respective from_pretrained methods. We then encode a news article using the tokenizer, pass the inputs through the model, and extract the predicted label using the argmax function. Finally, we map the predicted label to its corresponding category using a list of labels.

Contributors

This model was fine-tuned by CHERGUELAINE Ayoub .

Runs of AyoubChLin bert_cnn_news on huggingface.co

79
Total runs
3
24-hour runs
21
3-day runs
65
7-day runs
69
30-day runs

More Information About bert_cnn_news huggingface.co Model

More bert_cnn_news license Visit here:

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

bert_cnn_news huggingface.co

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

AyoubChLin bert_cnn_news online free

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

AyoubChLin bert_cnn_news online free url in huggingface.co:

https://huggingface.co/AyoubChLin/bert_cnn_news

bert_cnn_news install

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

bert_cnn_news install url in huggingface.co:

https://huggingface.co/AyoubChLin/bert_cnn_news

Url of bert_cnn_news

bert_cnn_news huggingface.co Url

Provider of bert_cnn_news huggingface.co

AyoubChLin
ORGANIZATIONS

Other API from AyoubChLin