Edit model card

Laptop-T5-Base

The Laptop-T5-Base model was introduced in A Simple yet Effective Framework for Few-Shot Aspect-Based Sentiment Analysis (SIGIR'23) by Zengzhi Wang, Qiming Xie, and Rui Xia.

The details are available at Github:FS-ABSA and SIGIR'23 paper.

Model Description

To bridge the domain gap between general pre-training and the task of interest in a specific domain (i.e., laptop in this repo), we conducted domain-adaptive pre-training, i.e., continuing pre-training the language model (i.e., T5) on the unlabeled corpus of the domain of interest (i.e., laptop) with the text-infilling objective (corruption rate of 15% and average span length of 1). We collect relevant 100k unlabeled reviews from Amazon Electronics for the laptop domain. For pre-training, we employ the Adafactor optimizer with a batch size of 84 and a constant learning rate of 1e-4.

Our model can be seen as an enhanced T5 model in the laptop domain, which can be used for various NLP tasks related to the laptop domain, including but not limited to fine-grained sentiment analysis (ABSA), product-relevant Question Answering (PrQA), text style transfer, etc.

>>> from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

>>> tokenizer = AutoTokenizer.from_pretrained("NUSTM/laptop-t5-base")
>>> model = AutoModelForSeq2SeqLM.from_pretrained("NUSTM/laptop-t5-base")

>>> input_ids = tokenizer(
...    "The pizza here is delicious!!", return_tensors="pt"
... ).input_ids  # Batch size 1
>>> outputs = model(input_ids=input_ids)

Citation

If you find this work helpful, please cite our paper as follows:

@inproceedings{10.1145/3539618.3591940,
author = {Wang, Zengzhi and Xie, Qiming and Xia, Rui},
title = {A Simple yet Effective Framework for Few-Shot Aspect-Based Sentiment Analysis},
year = {2023},
isbn = {9781450394086},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3539618.3591940},
doi = {10.1145/3539618.3591940},
abstract = {The pre-training and fine-tuning paradigm has become the main-stream framework in the field of Aspect-Based Sentiment Analysis (ABSA). Although it has achieved sound performance in the domains containing enough fine-grained aspect-sentiment annotations, it is still challenging to conduct few-shot ABSA in domains where manual annotations are scarce. In this work, we argue that two kinds of gaps, i.e., domain gap and objective gap, hinder the transfer of knowledge from pre-training language models (PLMs) to ABSA tasks. To address this issue, we introduce a simple yet effective framework called FS-ABSA, which involves domain-adaptive pre-training and text-infilling fine-tuning. We approach the End-to-End ABSA task as a text-infilling problem and perform domain-adaptive pre-training with the text-infilling objective, narrowing the two gaps and consequently facilitating the knowledge transfer. Experiments show that the resulting model achieves more compelling performance than baselines under the few-shot setting while driving the state-of-the-art performance to a new level across datasets under the fully-supervised setting. Moreover, we apply our framework to two non-English low-resource languages to demonstrate its generality and effectiveness.},
booktitle = {Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval},
pages = {1765–1770},
numpages = {6},
keywords = {few-shot learning, opinion mining, sentiment analysis},
location = {Taipei, Taiwan},
series = {SIGIR '23}
}
Downloads last month
15
Safetensors
Model size
223M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.