Transfer learning, where a model is first pre-trained on a data-rich task before being fine-tuned on a downstream task, has emerged as a powerful technique in natural language processing (NLP). The effectiveness of transfer learning has given rise to a diversity of approaches, methodology, and practice. In this paper, we explore the landscape of transfer learning techniques for NLP by introducing a unified framework that converts every language problem into a text-to-text format. Our systematic study compares pre-training objectives, architectures, unlabeled datasets, transfer approaches, and other factors on dozens of language understanding tasks. By combining the insights from our exploration with scale and our new “Colossal Clean Crawled Corpus”, we achieve state-of-the-art results on many benchmarks covering summarization, question answering, text classification, and more. To facilitate future work on transfer learning for NLP, we release our dataset, pre-trained models, and code.
Details of the downstream task (Sequence Classification as Text generation) - Dataset 📚
For Twitter training and testing datasets are provided for sarcasm detection tasks in jsonlines format.
Each line contains a JSON object with the following fields :
label
:
SARCASM
or
NOT_SARCASM
NOT
in test data
id
: String identifier for sample. This id will be required when making submissions.
ONLY
in test data
response
: the sarcastic response, whether a sarcastic Tweet
context
: the conversation context of the
response
Note, the context is an ordered list of dialogue, i.e., if the context contains three elements,
c1
,
c2
,
c3
, in that order, then
c2
is a reply to
c1
and
c3
is a reply to
c2
. Further, if the sarcastic response is
r
, then
r
is a reply to
c3
.
For instance, for the following training example :
"label": "SARCASM", "response": "Did Kelly just call someone else messy? Baaaahaaahahahaha", "context": ["X is looking a First Lady should . #classact, "didn't think it was tailored enough it looked messy"]
The response tweet, "Did Kelly..." is a reply to its immediate context "didn't think it was tailored..." which is a reply to "X is looking...". Your goal is to predict the label of the "response" while also using the context (i.e, the immediate or the full context).
Dataset size statistics
:
Train
Val
Test
Twitter
4050
450
500
The datasets was preprocessed to convert it to a
text-to-text
(classfication as generation task).
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("mrm8488/t5-base-finetuned-sarcasm-twitter")
model = AutoModelWithLMHead.from_pretrained("mrm8488/t5-base-finetuned-sarcasm-twitter")
defeval_conversation(text):
input_ids = tokenizer.encode(text + '</s>', return_tensors='pt')
output = model.generate(input_ids=input_ids, max_length=3)
dec = [tokenizer.decode(ids) for ids in output]
label = dec[0]
return label
# For similarity with the training dataset we should replace users mentions in twits for @USER token and urls for URL token.
twit1 = "Trump just suspended the visa program that allowed me to move to the US to start @USER!" +
" Unfortunately, I won’t be able to vote in a few months but if you can, please vote him out, " +
"he's destroying what made America great in so many different ways!"
twit2 = "@USER @USER @USER We have far more cases than any other country, " +
"so leaving remote workers in would be disastrous. Makes Trump sense."
twit3 = "My worry is that i wouldn’t be surprised if half the country actually agrees with this move..."
me = "Trump doing so??? It must be a mistake... XDDD"
conversation = twit1 + twit2
eval_conversation(conversation) #Output: 'derison'
conversation = twit1 + twit3
eval_conversation(conversation) #Output: 'normal'
conversation = twit1 + me
eval_conversation(conversation) #Output: 'derison'# We will get 'normal' when sarcasm is not detected and 'derison' when detected
Runs of mrm8488 t5-base-finetuned-sarcasm-twitter on huggingface.co
9.5K
Total runs
0
24-hour runs
-34
3-day runs
-30
7-day runs
4.9K
30-day runs
More Information About t5-base-finetuned-sarcasm-twitter huggingface.co Model
t5-base-finetuned-sarcasm-twitter huggingface.co
t5-base-finetuned-sarcasm-twitter huggingface.co is an AI model on huggingface.co that provides t5-base-finetuned-sarcasm-twitter's model effect (), which can be used instantly with this mrm8488 t5-base-finetuned-sarcasm-twitter model. huggingface.co supports a free trial of the t5-base-finetuned-sarcasm-twitter model, and also provides paid use of the t5-base-finetuned-sarcasm-twitter. Support call t5-base-finetuned-sarcasm-twitter model through api, including Node.js, Python, http.
t5-base-finetuned-sarcasm-twitter huggingface.co is an online trial and call api platform, which integrates t5-base-finetuned-sarcasm-twitter's modeling effects, including api services, and provides a free online trial of t5-base-finetuned-sarcasm-twitter, you can try t5-base-finetuned-sarcasm-twitter online for free by clicking the link below.
mrm8488 t5-base-finetuned-sarcasm-twitter online free url in huggingface.co:
t5-base-finetuned-sarcasm-twitter is an open source model from GitHub that offers a free installation service, and any user can find t5-base-finetuned-sarcasm-twitter on GitHub to install. At the same time, huggingface.co provides the effect of t5-base-finetuned-sarcasm-twitter install, users can directly use t5-base-finetuned-sarcasm-twitter installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
t5-base-finetuned-sarcasm-twitter install url in huggingface.co: