Closed BruceLee66 closed 5 years ago
for line in open(dir + 'sim.txt'): sim = float(line.strip()) ceil = int(math.ceil(sim)) floor = int(math.floor(sim)) tmp = [0, 0, 0, 0, 0, 0] if floor != ceil: tmp[ceil] = sim - floor tmp[floor] = ceil - sim else: tmp[floor] = 1 labels.append(tmp)
The code in the image is from the model.py file in the PWIM model.I don't understand why in the STS task, the final dimension of the output is [1, 2].
Ok, I got your point. Actually the PWIM repo is for my NAACL 18 paper, which I tried character embedding for MSRP, URL and PIT. All these tasks have only two classes. Sorry about the confusing part, you can remove this line and change the num_class accordingly.
First,i have not found this function 'readSTSdata()' in your code, Secondly,When the model is initialized, there is a corresponding classification,Such as STS(6), TrecQA(2),but in the end it becomes 2 classes by default in the forward function.Is it really right? Finally,How do you solve the similarity problem with the classified code? Some of the code is not very clear.