Skip to content
Snippets Groups Projects
Commit 2c8043df authored by pabvald's avatar pabvald
Browse files

Evaluation completed

parent bb4827fd
Branches
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
from load import load_file
import os
import io
```
%% Cell type:code id: tags:
``` python
def load_SICK(path, verbose=False):
if verbose:
print('***** Task: SICK-Relatedness*****\n\n')
sick_train = load_file_SICK(os.path.join(path, 'SICK_train.txt'))
sick_dev = load_file_SICK(os.path.join(path, 'SICK_trial.txt'))
sick_test = load_file_SICK(os.path.join(path, 'SICK_test_annotated.txt'))
return sick_train
def load_file_SICK(path):
skipFirstLine = True
sick_data = {'sent_1': [], 'sent_2': [], 'sim': []}
with io.open(path, 'r', encoding='utf-8') as f:
for line in f:
if skipFirstLine:
skipFirstLine = False
else:
text = line.strip().split('\t')
sick_data['sent_1'].append(text[1].split())
sick_data['sent_2'].append(text[2].split())
sick_data['sim'].append(text[3])
sick_data['sim'] = [float(s) for s in sick_data['sim']]
return sick_data
```
%% Cell type:code id: tags:
``` python
a = load_SICK('./data/datasets/SICK/')
```
%% Cell type:code id: tags:
``` python
```
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment