coderchen01 commited on
Commit
cc78864
·
verified ·
1 Parent(s): f65a6d4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +51 -0
README.md CHANGED
@@ -1,3 +1,54 @@
1
  ---
2
  license: unknown
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: unknown
3
+ task_categories:
4
+ - feature-extraction
5
+ - text-classification
6
+ - image-classification
7
+ - image-feature-extraction
8
+ - zero-shot-classification
9
+ - zero-shot-image-classification
10
+ language:
11
+ - en
12
+ tags:
13
+ - sarcasm
14
+ - sarcasm-detection
15
+ - mulitmodal-sarcasm-detection
16
+ - sarcasm detection
17
+ - multimodao sarcasm detection
18
+ - tweets
19
+ pretty_name: mmsd_v2
20
+ size_categories:
21
+ - 10K<n<100K
22
  ---
23
+
24
+ # MMSD2.0: Towards a Reliable Multi-modal Sarcasm Detection System
25
+
26
+ This is a copy of the dataset uploaded on Hugging Face for easy access. The original data comes from this [work](https://aclanthology.org/2023.findings-acl.689/).
27
+
28
+ ## Usage
29
+
30
+ ```python
31
+ # usage
32
+ from datasets import load_dataset
33
+ from transformers import CLIPImageProcessor, CLIPTokenizer
34
+ from torch.utils.data import DataLoader
35
+
36
+ image_processor = CLIPImageProcessor.from_pretrained(clip_path)
37
+ tokenizer = CLIPTokenizer.from_pretrained(clip_path)
38
+
39
+ def tokenization(example):
40
+ text_inputs = tokenizer(example["text"], truncation=True, padding=True, return_tensors="pt")
41
+ image_inputs = image_processor(example["image"], return_tensors="pt")
42
+ return {'pixel_values': image_inputs['pixel_values'],
43
+ 'input_ids': text_inputs['input_ids'],
44
+ 'attention_mask': text_inputs['attention_mask'],
45
+ "label": example["label"]}
46
+
47
+ dataset = load_dataset('quaeast/multimodal_sarcasm_detection')
48
+ dataset.set_transform(tokenization)
49
+
50
+ # get torch dataloader
51
+ train_dl = DataLoader(dataset['train'], batch_size=256, shuffle=True)
52
+ test_dl = DataLoader(dataset['test'], batch_size=256, shuffle=True)
53
+ val_dl = DataLoader(dataset['validation'], batch_size=256, shuffle=True)
54
+ ```