Instructions to use shuaifan/SentiWSP-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shuaifan/SentiWSP-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="shuaifan/SentiWSP-base")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("shuaifan/SentiWSP-base") model = AutoModelForSequenceClassification.from_pretrained("shuaifan/SentiWSP-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
SentiWSP
For paper: Sentiment-Aware Word and Sentence Level Pre-training for Sentiment Analysis
We propose SentiWSP, a novel Sentiment-aware pre-trained language model with combined Word-level and Sentence-level Pre-training tasks. The word level pre-training task detects replaced sentiment words, via a generator-discriminator framework, to enhance the PLM's knowledge about sentiment words. The sentence level pre-training task further strengthens the discriminator via a contrastive learning framework, with similar sentences as negative samples, to encode sentiments in a sentence.
Fine-tunning
You can also load our model in huggingface (https://huggingface.co/shuaifan/SentiWSP-base) to fine-tunning in sentiment analysis tasks:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("shuaifan/SentiWSP-base")
model = AutoModelForSequenceClassification.from_pretrained("shuaifan/SentiWSP-base")
- Downloads last month
- 6