forked from Jimin9401/avocado
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.py
55 lines (41 loc) · 1.25 KB
/
examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import json
import logging
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',
datefmt='%m/%d/%Y %H:%M:%S',
level=logging.INFO)
logger = logging.getLogger(__name__)
class CFExample(object):
"""A single training/test example."""
def __init__(self,
idx,
text,
y,
):
self.idx = idx
self.text = text
self.y = y
class ContrastiveExample(object):
"""A single training/test example."""
def __init__(self,
idx,
domain_text,
origin_text,
y):
self.idx = idx
self.domain_text = domain_text
self.origin_text = origin_text
self.y = y
class InputFeatures(object):
"""A single training/test features for a example."""
def __init__(self,
example_id,
source_ids,
target_ids,
source_mask,
target_mask,
):
self.example_id = example_id
self.source_ids = source_ids
self.target_ids = target_ids
self.source_mask = source_mask
self.target_mask = target_mask