File size: 3,404 Bytes
b109984
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
Chemprot Relation Classification Dataset
https://github.com/yueyu1030/COSINE/tree/main/data/chemprot



# Labels

    "0": "Part of",
    "1": "Regulator",
    "2": "Upregulator",
    "3": "Downregulator",
    "4": "Agonist",
    "5": "Antagonist",
    "6": "Modulator",
    "7": "Cofactor",
    "8": "Substrate/Product",
    "9": "NOT"




# Labeling Functions


## Part of
@labeling_function()
def lf_amino_acid(x):
    return 1 if 'amino acid' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_replace(x):
    return 1 if 'replace' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_mutant(x):
    return 1 if 'mutant' in x.sentence.lower() or 'mutat' in x.sentence.lower() else ABSTAIN








## Regulator
@labeling_function()
def lf_bind(x):
    return 2 if 'bind' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_interact(x):
    return 2 if 'interact' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_affinity(x):
    return 2 if 'affinit' in x.sentence.lower() else ABSTAIN









## Upregulator
# Activator
@labeling_function()
def lf_activate(x):
    return 3 if 'activat' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_increase(x):
    return 3 if 'increas' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_induce(x):
    return 3 if 'induc' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_stimulate(x):
    return 3 if 'stimulat' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_upregulate(x):
    return 3 if 'upregulat' in x.sentence.lower() else ABSTAIN












## Downregulator
@labeling_function()
def lf_downregulate(x):
    return 4 if 'downregulat' in x.sentence.lower() or 'down-regulat' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_reduce(x):
    return 4 if 'reduc' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_inhibit(x):
    return 4 if 'inhibit' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_decrease(x):
    return 4 if 'decreas' in x.sentence.lower() else ABSTAIN











## Agonist
@labeling_function()
def lf_agonist(x):
    return 5 if ' agoni' in x.sentence.lower() or "\tagoni" in x.sentence.lower() else ABSTAIN









## Antagonist
@labeling_function()
def lf_antagonist(x):
    return 6 if 'antagon' in x.sentence.lower() else ABSTAIN









## Modulator
@labeling_function()
def lf_modulate(x):
    return 7 if 'modulat' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_allosteric(x):
    return 7 if 'allosteric' in x.sentence.lower() else ABSTAIN









## Cofactor
@labeling_function()
def lf_cofactor(x):
    return 8 if 'cofactor' in x.sentence.lower() else ABSTAIN








## Substrate/Product
@labeling_function()
def lf_substrate(x):
    return 9 if 'substrate' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_transport(x):
    return 9 if 'transport' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_catalyze(x):
    return 9 if 'catalyz' in x.sentence.lower() or 'catalys' in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_product(x):
    return 9 if "produc" in x.sentence.lower() else ABSTAIN

@labeling_function()
def lf_convert(x):
    return 9 if "conver" in x.sentence.lower() else ABSTAIN









## NOT
@labeling_function()
def lf_not(x):
    return 10 if 'not' in x.sentence.lower() else ABSTAIN