Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 55e5974

Browse files
committed
reweight
1 parent 8ad71f9 commit 55e5974

File tree

128 files changed

+454173
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+454173
-11
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
__pycache__/
2+
state_dict/
23
*.dat
34
*.h5
45
*log*
6+
*.npy
57
glove*
68

79
# OSX
@@ -35,4 +37,4 @@ Thumbs.db
3537
*.class
3638
# generated files
3739
bin/
38-
gen/
40+
gen/

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations":
7+
[
8+
{
9+
"name": "ABSA",
10+
"type": "python",
11+
"request": "launch",
12+
"program": "./train.py",
13+
"console": "integratedTerminal",
14+
"args":
15+
[
16+
"--model_name","td_bert",
17+
"--dataset", "twitter-resplit",
18+
"--device", "cuda:0",
19+
"--load", "1"
20+
]
21+
}
22+
]
23+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "/home/xiangpan/.conda/envs/pytorch/bin/python"
3+
}

data_utils.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,18 @@ def text_to_sequence(self, text, reverse=False, padding='post', truncating='post
123123

124124

125125
class ABSADataset(Dataset):
126-
def __init__(self, fname, tokenizer):
126+
def __init__(self, fname, tokenizer,opt):
127127
fin = open(fname, 'r', encoding='utf-8', newline='\n', errors='ignore')
128128
lines = fin.readlines()
129129
fin.close()
130130

131+
if opt.load == 1:
132+
npy_name = fname.replace(".txt", ".npy")
133+
if os.path.exists(npy_name):
134+
all_data = np.load(npy_name, allow_pickle=True)
135+
self.data = all_data
136+
return
137+
131138
all_data = []
132139
for i in range(0, len(lines), 3):
133140
text_left, _, text_right = [s.lower().strip() for s in lines[i].partition("$T$")]
@@ -172,6 +179,8 @@ def __init__(self, fname, tokenizer):
172179
}
173180

174181
all_data.append(data)
182+
npy_name = fname.replace(".txt", ".npy")
183+
np.save(npy_name, all_data)
175184
self.data = all_data
176185

177186
def __getitem__(self, index):
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 4
6+
}

datasets/resplit/Untitled.ipynb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 4
6+
}

datasets/resplit/laptop/dev.txt

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
Everything I wanted and everything I needed and the $T$ was great !
2+
price
3+
1
4+
great $T$ free shipping what else can i ask for !!
5+
price
6+
1
7+
:-RRB- Great product , great $T$ , great delivery , and great service .
8+
price
9+
1
10+
:-RRB- Great product , great price , great $T$ , and great service .
11+
delivery
12+
1
13+
I had the same reasons as most PC users : the $T$ , the overbearing restrictions of OSX and lack of support for games .
14+
price
15+
-1
16+
I had the same reasons as most PC users : the price , the overbearing restrictions of OSX and lack of $T$ .
17+
support for games
18+
-1
19+
it has all the features that we expected and the $T$ was good , working well so far .
20+
price
21+
1
22+
Thanks for the fast $T$ and great price .
23+
shipment
24+
1
25+
Thanks for the fast shipment and great $T$ .
26+
price
27+
1
28+
$T$ was higher when purchased on MAC when compared to price showing on PC when I bought this product .
29+
price
30+
-1
31+
Price was higher when purchased on MAC when compared to $T$ showing on PC when I bought this product .
32+
price
33+
1
34+
It 's absolutely wonderful and worth the $T$ !
35+
price
36+
1
37+
CONS : $T$ is a bit ridiculous , kinda heavy .
38+
price
39+
-1
40+
Premium $T$ for the OS more than anything else .
41+
price
42+
1
43+
If you ask me , for this $T$ it should be included .
44+
price
45+
-1
46+
I got this at an amazing $T$ from Amazon and it arrived just in time .
47+
price
48+
1
49+
It 's a decent computer for the $T$ and hopefully it will last a long time .
50+
price
51+
0
52+
The $T$ is 200 dollars down .
53+
price
54+
1
55+
The best thing about this laptop is the $T$ along with some of the newer features .
56+
price
57+
1
58+
This laptop is a great $T$ and has a sleek look .
59+
price
60+
1
61+
Am very glad I bought it , great netbook , low $T$ .
62+
price
63+
1
64+
Like the $T$ and operation .
65+
price
66+
1
67+
Great Laptop for the $T$ , works well with action pack games .
68+
price
69+
1
70+
Great Laptop for the price , works well with $T$ .
71+
action pack games
72+
0
73+
Although the $T$ is higher then Dell laptops , the Macbooks are worth the dough .
74+
price
75+
-1
76+
It 's super fast and a great value for the $T$ !
77+
price
78+
1
79+
Waiting for the i7 was well worth it , great value for the $T$ .
80+
price
81+
1
82+
Waiting for the $T$ was well worth it , great value for the price .
83+
i7
84+
1
85+
I bought this laptop because of the performance to $T$ ratio .
86+
price
87+
1
88+
Reason why ? It 's because when you buy it , you know first thing that you will not lose any value for that laptop , the $T$ will stay the same for the next year , and even if Apple does decides to change mode , your laptop value will only drop 10-20 % , unlike PC laptops which drop more than 80 % .
89+
price
90+
1
91+
The $T$ and features more than met my needs .
92+
price
93+
1
94+
and looks very sexyy :D really the mac book pro is the best laptop specially for students in college if you are not caring about $T$ .
95+
price
96+
-1
97+
The $T$ is another driving influence that made me purchase this laptop .
98+
price
99+
1
100+
All for such a great $T$ .
101+
price
102+
1
103+
you can find many laptops with the same performance and even better with lower $T$ , but you can not find the look , easy , applications , and the experience in mac .
104+
price
105+
1
106+
It 's a great product for a great $T$ !
107+
price
108+
1
109+
I wiped nearly everything off of it , installed $T$ and Firefox , and I am operating an incredibly efficient and useful machine for a great price .
110+
openoffice
111+
0
112+
I wiped nearly everything off of it , installed OpenOffice and Firefox , and I am operating an incredibly efficient and useful machine for a great $T$ .
113+
price
114+
1
115+
At first , the computer seemed a great deal -- seemingly high-end $T$ for a low , low price .
116+
specs
117+
1
118+
At first , the computer seemed a great deal -- seemingly high-end specs for a low , low $T$ .
119+
price
120+
1
121+
For the $T$ and what I get out of it has exceeded my expectations .
122+
price
123+
1
124+
I thought the $T$ was great for the specs .
125+
price
126+
1
127+
I thought the price was great for the $T$ .
128+
specs
129+
1
130+
I finally decided on this laptop because it was the right $T$ for what I need it .
131+
price
132+
1
133+
The only downfall is a lot of the software I have wo n't work with Mac and iWork is not worth the $T$ of it .
134+
price
135+
-1
136+
For the same $T$ , you get a lot more in the Asus ... 1920x1080 res .
137+
price
138+
-1
139+
For the -LSB- $ -RSB- $T$ -LRB- special offer -RRB- this is a great laptop .
140+
price
141+
1
142+
I looked around and based off my $T$ / features comparison from a brand I trusted I landed here .
143+
price
144+
0
145+
LOVE THIS LAPTOP WONDERFUL $T$ FOR WHAT YOU GET !
146+
price
147+
1
148+
It is easy to use , good quality and good $T$ .
149+
price
150+
1
151+
True quality at a great $T$ !
152+
price
153+
1
154+
After doing extensive research , macconnection had the lowest $T$ on the 15 '' MBP i5 .
155+
price
156+
1
157+
I saw walmart had the same computer for about $ 650 but still knowing what I know now , I would not buy it at that $T$ .
158+
price
159+
-1
160+
Peformance is good for the $T$ .
161+
price
162+
1
163+
The 13 '' Macbook Pro just fits in my budget and with free shipping and no tax to CA this is the best $T$ we can get for a great product .
164+
price
165+
1
166+
The 13 '' Macbook Pro just fits in my $T$ and with free shipping and no tax to CA this is the best price we can get for a great product .
167+
budget
168+
1
169+
The 13 '' Macbook Pro just fits in my budget and with free shipping and no tax to CA this is the best $T$ we can get for a great product .
170+
price
171+
1
172+
The 13 '' Macbook Pro just fits in my $T$ and with free shipping and no tax to CA this is the best price we can get for a great product .
173+
budget
174+
1
175+
A cheaper $T$ should not equal a `` cheap '' product .
176+
price
177+
1
178+
I know there are way better laptops out there for the same $T$ , and why spend money on shit when you can go out and get yourself a perfectly decent laptop that doesnt suck total monkey balls .
179+
price
180+
0
181+
It did n't come with any software installed outside of $T$ , but for the price , I was very pleased with the condition and the overall product .
182+
windows media
183+
0
184+
It did n't come with any software installed outside of windows media , but for the $T$ , I was very pleased with the condition and the overall product .
185+
price
186+
1
187+
Disappointing for such a lovely screen and at a reasonable $T$
188+
price
189+
1
190+
Good $T$ .
191+
price
192+
1
193+
We researched and found the best $T$ at MacConnection .
194+
price
195+
1
196+
Again , decent comp for the $T$ , and I was in need of one quickly as my other laptop died on me .
197+
price
198+
1
199+
The $T$ was very good , and the product is top quality .
200+
price
201+
1
202+
Battery life could be better but overall for the $T$ and Toshiba 's reputation for laptops it 's great !
203+
price
204+
1
205+
Apparently well-built and gorgeous to look at , the i5 MacBook Pro is a winning combination of $T$ and performance .
206+
price
207+
1
208+
I 'm really impressed with the quality and performance for the $T$ of the computer .
209+
price
210+
1
211+
So then you may be lucky to get ahold to someone who understands that its no good and they will let you send it back , but of course you are taking a chance of them testing it out to see what has happened , and they tell you that it was not on their side , then you are stuck paying for the repair -LRB- the $T$ of a new one -RRB- .
212+
price
213+
-1
214+
The best thing to do is build your own computer , but if u ca n't company 's like dell who allow you to choose the components are better and for the same $T$ you can get a computer who compares to one of apple $ 2000 systems and if you google `` dell coupons '' you can find codes that take a signifant amount off the price .
215+
price
216+
1
217+
The best thing to do is build your own computer , but if u ca n't company 's like dell who allow you to choose the components are better and for the same price you can get a computer who compares to one of apple $ 2000 systems and if you google `` dell coupons '' you can find codes that take a signifant amount off the $T$ .
218+
price
219+
1
220+
For me I was lucky and a local store was selling them for $ 2000 off and Best Buy matched their $T$ so I was able to buy one for under $ 1000
221+
price
222+
1
223+
I believe that the quality of a mac is worth the $T$ .
224+
price
225+
1
226+
Overall : Poor , Features : Average , Performance : Poor , Battery Life : Excellent , $T$ - Value : Poor
227+
price
228+
-1
229+
$T$ and purpose is awesome !
230+
price
231+
1
232+
Worse , for the $T$ I could get a * netbook * that outperforms this machine .
233+
price
234+
-1
235+
The $T$ is great for this model , I only plan on using it for media in the entertainment room .
236+
price
237+
1
238+
Was very much worth the $T$ i paid .
239+
price
240+
1
241+
This is a great little computer for the $T$ .
242+
price
243+
1
244+
The Toshiba Satellite has been more than I expected for the $T$ .
245+
price
246+
1

0 commit comments

Comments
 (0)