Skip to content

Commit

Permalink
fix class value
Browse files Browse the repository at this point in the history
  • Loading branch information
kermitt2 committed Aug 28, 2023
1 parent 2f8976c commit e22c86c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions delft/textClassification/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ def load_dataseer_corpus_csv(filepath):
reuse_list = np.asarray(reuse_list)
# map boolean values to [0,1]
def map_boolean(x):
return [1.0,0.0] if x else [0.0,1.0]
return [1.0,0.0] if x == 'no_reuse' else [0.0,1.0]
reuse_list = np.array(list(map(map_boolean, reuse_list)))
print(reuse_list)
return np.asarray(texts_list), reuse_list, None, None, ["not_reuse", "reuse"], None, None
return np.asarray(texts_list), reuse_list, None, None, ["no_reuse", "reuse"], None, None

# otherwise we have the list of datatypes, and optionally subtypes and leaf datatypes
datatypes = df.iloc[:,2]
Expand Down

0 comments on commit e22c86c

Please sign in to comment.