Commit c3730278 authored by schnurr's avatar schnurr
Browse files

Update probing.py

parent 7ea725f4
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ def mask_first(pos_tag):
    df = STSB_Dataset('data/stsbenchmark/sts-test.csv').as_dataframe

    i = -1
    del_rows = []

    for sent1 in sentences1_nlp:
        i += 1
@@ -104,8 +103,7 @@ def mask_first(pos_tag):
            e = pos_tags_sent.index(pos_tag)
            df.iloc[i, 0] = df.iloc[i, 0].replace(pos_tag_tokens[e], get_random_string(random.randrange(1, 9)))
        else:
            if i not in del_rows:
                del_rows.append(i)
            continue
    
    i = -1
    for sent2 in sentences2_nlp:
@@ -117,8 +115,6 @@ def mask_first(pos_tag):
            e = pos_tags_sent.index(pos_tag)
            df.iloc[i, 1] = df.iloc[i, 1].replace(pos_tag_tokens[e], get_random_string(random.randrange(1, 9)))
        else:
            if i not in del_rows:
                del_rows.append(i)
            continue
        
    df.drop(del_rows, inplace=True)
    return df