Skip to content

Commit

Permalink
Merge pull request #257 from sadimanna/main
Browse files Browse the repository at this point in the history
updated SentEval/senteval/sts.py
  • Loading branch information
gaotianyu1350 authored Jul 2, 2024
2 parents 13361d0 + ec1494c commit 7edb07e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SentEval/senteval/sts.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def loadFile(self, fpath):
not_empty_idx = raw_scores != ''

gs_scores = [float(x) for x in raw_scores[not_empty_idx]]
sent1 = np.array([s.split() for s in sent1])[not_empty_idx]
sent2 = np.array([s.split() for s in sent2])[not_empty_idx]
sent1 = np.array([s.split() for s in sent1], dtype=object)[not_empty_idx]
sent2 = np.array([s.split() for s in sent2], dtype=object)[not_empty_idx]
# sort data by length to minimize padding in batcher
sorted_data = sorted(zip(sent1, sent2, gs_scores),
key=lambda z: (len(z[0]), len(z[1]), z[2]))
Expand Down

0 comments on commit 7edb07e

Please sign in to comment.