Erlangshen Roberta 330 M Sentiment

IDEA-CCNL

Introduction

Erlangshen-Roberta-330M-Sentiment is a fine-tuned version of the Chinese RoBERTa-wwm-ext-large model, specifically for sentiment analysis tasks in the Chinese language. It has been adapted using several Chinese sentiment analysis datasets, providing robust performance in understanding sentiment in text.

Architecture

The model is based on the chinese-roberta-wwm-ext-large architecture. It has been trained on a comprehensive set of 8 sentiment analysis datasets, comprising a total of 227,347 samples. This extensive training enables it to deliver high accuracy in various sentiment analysis benchmarks.

Training

The Erlangshen-Roberta-330M-Sentiment model was fine-tuned on a wide range of sentiment datasets. Performance metrics on key datasets are as follows:

  • ASAP-SENT: 97.9%
  • ASAP-ASPECT: 97.51%
  • ChnSentiCorp: 96.66%

Compared to other models such as Erlangshen-Roberta-110M-Sentiment and Erlangshen-MegatronBert-1.3B-Sentiment, it offers competitive accuracy in sentiment analysis tasks.

Guide: Running Locally

To run the Erlangshen-Roberta-330M-Sentiment model locally, follow these steps:

  1. Install Dependencies: Ensure you have Python and PyTorch installed. Install the transformers library with pip install transformers.

  2. Load the Model: Use the following Python code to load and run the model:

    from transformers import BertForSequenceClassification
    from transformers import BertTokenizer
    import torch
    
    tokenizer = BertTokenizer.from_pretrained('IDEA-CCNL/Erlangshen-Roberta-330M-Sentiment')
    model = BertForSequenceClassification.from_pretrained('IDEA-CCNL/Erlangshen-Roberta-330M-Sentiment')
    
    text = '今天心情不好'
    output = model(torch.tensor([tokenizer.encode(text)]))
    print(torch.nn.functional.softmax(output.logits, dim=-1))
    
  3. Cloud GPUs: For improved performance, consider using cloud-based GPU services like AWS EC2, Google Cloud, or Azure to handle intensive computation.

License

The Erlangshen-Roberta-330M-Sentiment model is released under the Apache-2.0 license, which allows for both personal and commercial use with proper attribution.

More Related APIs in Text Classification