image
imagewidth (px)
48
1.2k
text
stringlengths
4
665
label
int64
0
1
id
stringlengths
18
18
ummmmmmm , that oyster sure does give an amazing reward ! # runescape
1
682721949072625664
a great picture to finish this year and louis reprensent the fandom # directioners <user> emoji_276
1
682722242111774720
happy new year guys ! ! ;)
1
682727470433308672
sometimes genius just happens by accident ... # artsymistake # nailselfie # nye2016 # sparkles # nyenails emoji_92 emoji_517
1
682751920956641280
# righttovote comes first . # vote # voting # votingrights # votebernie # votetrump # statism # liberty # anarchism
1
682762265041321989
yes . yes it is . # dealwithit # bigcattruths # bigcatfacts modeon <user>
1
682773510196822016
too bad alabama doesn 't have a solid defense or high-powered offense . # rolltide # bamavsmsu
1
682784347305410560
happy new year , we are back to work next tuesday 5th january ! # yeah
1
682836685323956224
me , hanging out with the pasta this new years ! ! # 2016 # party really # bestnightever
1
682864661813981184
i went to # 32c3 and all i got was this stupid bracelet
1
682883715681390593
<user> your app in england . adds are working though you 'd be pleased to know . # fail
1
682906033312935936
lol first time taking it # nocalculator # imthatgood
1
682931582357893120
be thankful for all the small things in life , sometimes they mean the most . # thankful # gratitude
1
682931696845611008
when you realize how brown you are .. # white
1
682934584527466496
that 's ok , <user> <user> , i didn 't want to watch the nhl # winterclassic anyway # fixit emoji_97
1
682987076128657408
the official indian passport website 's under maintenance notification is epic
1
683009023247953921
the # broncos and elway need to pull a dikta in <num> to get christian mccaffrey . still , get him
1
683062203268780032
apparently this is what the carrollton arby 's considers a large fry ... box only half full . thanks <user>
1
683087755019026432
thanks <user> for another day of great service
1
683090662418288640
queues queues and more queues .. securities fence doing the job ;) # farce <user> <user>
1
683181977726418945
in tears emoji_1651
1
683182680360529920
this place is rubbish . i 'm heading home . # cycling # malta
1
683215653113823232
wow ang sweet naman !
1
683250958717956097
quite pleasant here today # winterishere
1
683275769330712577
yes , this pretty much sums it up .
1
683302904363638784
it 's safe to say , i like food # foodie # fitness # food emoji_15
1
683308322259398658
muslim anti terror demo 2day . you could barely move for all those tabloid journalists desperate to cover it
1
683324835745902592
# stlblues get their style back tonight # secretweapon # fanfav # noregrets # differencemaker # bergs
1
683337444511498240
why do humans cling to what soon will perish ? there 's a limit , once i was one of them . # stephenking
1
683344545027854336
i wont let you close enough to hurt me . you poor soul ! !
1
683355503947309056
easter eggs in january <user> please tell me when your halloween stuff will be available march or april ?
1
683364611513397248
<user> don 't like coleslaw honest lol xx
1
683365234229248004
... ah , boys are so great . # ohgodsarcasm # helpme # datingwhiletrans # gaytransguyproblems # transproblems
1
683417001570742274
great game ! <user> <user> # whereareyou
1
683431160127590400
eve had theapple . i have these . # thanksmom
1
683800787995066368
whoa , now it turns out jj ripped off wizard of oz too # dorothyismarysue <user>
1
683810612518993920
me and my friends outtake on the 'tyler oakley drama ' clearly the illuminati is key <user>
1
683836032756920320
don 't look away , assad is starving people . who cares ! not my kid . # assadkills many ways # uselessnations
1
683843373514514432
congrats , i see # guncontrol is working out well for y 'all . # chicago # nra # 2adefenders
1
683854138535358465
never seen an outsource deal that sounds like it started from here
1
683859183511285760
you know you 're in australia when <user> is drinking wine
1
683868783547551744
my wife bought me some coffee . - must have been the glasses ... # yyj # coffee <user>
1
683877353898950656
<user> <user> too bad you don 't get such great cereal in australia huh ... # justacerealbox
1
683882326179233793
looking up this stuff is sooo much fun
1
683882952938278912
<user> mornin sunshine # grumpycat
1
683889125745922048
such an attractive airport ! ! ! !
1
683926586698141696
thank you battery for dying
1
683945720840323072
way to go # schererville for keeping indiana in the news # myoldstompinggrounds # smh
1
683958598796505088
haha !
1
683979570568105985
# devereconstruction presence on l 'ville past <num> wks . i 'm sure <user> is on top of them . <user>
1
684001784088686592
welcome to toronto .... the true north ! woke up to some lovely weather today . # itsprettycold emoji_140 emoji_540 emoji_540 emoji_543
1
684036010636804096
i can tell moore really cares b / c of the shabby clothes he wears and not b / c of how rich he is ! ! !
1
684042671741091840
happy new year ! ! ! # wtf emoji_276
1
684043013388120065
why hello reality , nice of you to creep back so fast # comedy # mondaymotivation emoji_410
1
684043024830181376
brb , going to grab my zip disks and floppies to deploy software updates in an enterprise environment .
1
684047142906761216
lot of enthusiasm on display from young voters at the clinton rally in new hampshire
1
684048166224838656
haha ! # gags # funny # pout # bbloggers # bblog # beauty # selfie # followforfollow # likeforlike # jhallidiva
1
684051880524161026
with psn down , # starwarsbattlefront becomes an animated r2d2 wallpaper . hooray for always online games !
1
684110397914386433
why such a small box for such a big item <user> ?
1
684110747933237249
gotta love that <user> prime service ... this just keeps happening with my orders ... so worth
1
684127708486496259
add me on # snapchat & see my mundane behind the scenes life ... # twitter
1
684140022417780739
omg ! it snowed ! i wonder if work will be closed tomorrow .
1
684162257475997696
gotta love the high quality products from the lake stevens <user> . # yuck
1
684530584765333504
got a nice cold for the rest of winter # lovebeingill # foff
1
684536371386683392
rt <user> : oh please i alrdy hv become a groom once .. not anymore ;) dnt insist ...
1
684585518105899008
creating history by performing at <user> this year , but sad coz chetan is not impressed . # upnext
1
684649006606061568
the gene escaping ...
1
684698671594778624
" but kombats are so original , no one will mistake it for another fandom ! " yeah , it looks soooo different .
1
684741930924793856
unclear how russian media is portraying the ankara-moscow relationship cc <user> <user>
1
684751136490962945
finally getting some acknowledgment around here !
1
684751830425833472
i 'm really classy .
1
684788302143078400
lovely .
1
684821191039840256
shed for me then # motherinlaw
1
684835175738568704
great to see <user> embracing the best technology available .
1
684848251552567298
wisdom per barleys brewhaus # almostbetterthantacos <user> <user>
1
684920023475994626
after careful deliberation , i opted for the # selfie # photo at right for my professional # linkedin profile
1
684921998305312768
took me so long to get this guys , i waited for hours . thanks <user> (: # iscreenshotthatish
1
684923881421930496
a # piercing went bad , i resortedto a # lipbow . i 'm thinking its a # trendsetter # katespade # bows
1
684934265751093248
ughhhhh ... i can 't decide which one to get ! # sotough
1
684951892347252736
these things go well together
1
684979497074991104
rare engram <user> <user> is it any good ? # ready4nextib # 1000yardstare # destiny
1
685103804581216257
wow , <user> ! we found that spectacular sunrise you were talking about ! emoji_15 emoji_15 emoji_15
1
685107977460686849
... so every 'top story ' headline on <user> . com is hidden behind a pay wall . good on you , guys .
1
685113505276649473
made me think of <user> and <user> miss you gals ! # inappropriatelydressed
1
685117054953877505
thanks <user> , the # bullying and # harassment continue . the reporting process is so easy & effective .
1
685156039159853056
on a lighter note # delhi
1
685159825995505665
# 2016 is going to be great ! ifications # marketselloff # marketvolatility # china # chinameltdown
1
685164083117608960
current mood ! ! # attitude # ohwell
1
685168383738785792
very reassured by what i am hearing coming out of hampden <user> # rangers # sevco # zombieclub # sectarianism
1
685175113482944512
found donut photo ( not mine ) .. enjoy # lol # love is # beautiful e # thesimpsons # lessimpson # donut # ho …
1
685183064826351617
<user> glad to see ecological survey was submitted to bromley planning before you levelled the place
1
685190077555826692
it 's what 's for dinner .... yum
1
685190289431113728
now how can i send you an autographed pic when you don 't tell me your name ? ? ? # sillybilly # ktar
1
685204034815275008
# chickenfries from # burgerking was alright . i haven 't had # fastfood in months . # krizyhan # nyc # finedining
1
685221022937821184
<user> speaking some truth emoji_131 emoji_131 emoji_131
1
685234721282981889
having a blast losing to a hacker on my second game in months ! @ # funrun2 # catty3000 # 22
1
685236198298808320
winner of the most creative and breakthrough messaging at # ces16 .... # really ?
1
685236400854188033
thankyou # neworleans for your # pothole it 's what makes this place great , right ? and costly . # tire # imdone emoji_75
1
685248241412145152
the person who left this note was probably running low on # coffee # funny
1
685269360940822528
never to early to working on x 's and o 's ! ! ! # prodigy
1
685271249187110912

MMSD2.0: Towards a Reliable Multi-modal Sarcasm Detection System

This is a copy of the dataset uploaded on Hugging Face for easy access. The original data comes from this work, which is an improvement upon a previous study.

Usage

from typing import TypedDict, cast

import pytorch_lightning as pl
from datasets import Dataset, load_dataset
from torch import Tensor
from torch.utils.data import DataLoader
from transformers import CLIPProcessor


class MMSDModelInput(TypedDict):
    pixel_values: Tensor
    input_ids: Tensor
    attention_mask: Tensor
    label: Tensor
    id: list[str]


class MMSDDatasetModule(pl.LightningDataModule):

    def __init__(
        self,
        clip_ckpt_name: str = "openai/clip-vit-base-patch32",
        dataset_version: str = "mmsd-v2",
        max_length: int = 77,
        train_batch_size: int = 32,
        val_batch_size: int = 32,
        test_batch_size: int = 32,
        num_workers: int = 19,
    ) -> None:
        super().__init__()
        self.clip_ckpt_name = clip_ckpt_name
        self.dataset_version = dataset_version
        self.train_batch_size = train_batch_size
        self.val_batch_size = val_batch_size
        self.test_batch_size = test_batch_size
        self.num_workers = num_workers
        self.max_length = max_length

    def setup(self, stage: str) -> None:
        processor = CLIPProcessor.from_pretrained(self.clip_ckpt_name)

        def preprocess(example):
            inputs = processor(
                text=example["text"],
                images=example["image"],
                return_tensors="pt",
                padding="max_length",
                truncation=True,
                max_length=self.max_length,
            )

            return {
                "pixel_values": inputs["pixel_values"],
                "input_ids": inputs["input_ids"],
                "attention_mask": inputs["attention_mask"],
                "label": example["label"],
            }

        self.raw_dataset = cast(
            Dataset,
            load_dataset("coderchen01/MMSD2.0", name=self.dataset_version),
        )
        self.dataset = self.raw_dataset.map(
            preprocess,
            batched=True,
            remove_columns=["text", "image"],
        )

    def train_dataloader(self) -> DataLoader:
        return DataLoader(
            self.dataset["train"],
            batch_size=self.train_batch_size,
            shuffle=True,
            num_workers=self.num_workers,
        )

    def val_dataloader(self) -> DataLoader:
        return DataLoader(
            self.dataset["validation"],
            batch_size=self.val_batch_size,
            num_workers=self.num_workers,
        )

    def test_dataloader(self) -> DataLoader:
        return DataLoader(
            self.dataset["test"],
            batch_size=self.test_batch_size,
            num_workers=self.num_workers,
        )

References

[1] Yitao Cai, Huiyu Cai, and Xiaojun Wan. 2019. Multi-Modal Sarcasm Detection in Twitter with Hierarchical Fusion Model. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2506–2515, Florence, Italy. Association for Computational Linguistics.

[2] Libo Qin, Shijue Huang, Qiguang Chen, Chenran Cai, Yudi Zhang, Bin Liang, Wanxiang Che, and Ruifeng Xu. 2023. MMSD2.0: Towards a Reliable Multi-modal Sarcasm Detection System. In Findings of the Association for Computational Linguistics: ACL 2023, pages 10834–10845, Toronto, Canada. Association for Computational Linguistics.

Downloads last month
877
Edit dataset card