Loading src/probing.py +17 −2 Changes for src/probing.py: 17 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -66,8 +66,12 @@ def get_random_string(length): result_str = ''.join(random.choice(letters) for i in range(length)) return result_str def mask_token(pos_tag): def mask_token(pos_tag): """ For every sentence in the dataframe, mask that token whose POS matches the formal parameter and is also the highest in the dependency tree's structure. Return the changed dataframe. """ df = STSB_Dataset('../data/stsbenchmark/sts-test.csv').as_dataframe for e in range(len(dependency_hierarchy1)): Loading Loading @@ -95,7 +99,10 @@ def mask_token(pos_tag): def mask_first(pos_tag): """ For every sentence in the dataframe, mask that token whose POS matches the formal parameter. Return the changed dataframe. """ df = STSB_Dataset('../data/stsbenchmark/sts-test.csv').as_dataframe i = -1 Loading Loading @@ -127,6 +134,10 @@ def mask_first(pos_tag): def mask_first_token(): """ For every sentence in the dataframe, mask the first token. Return the changed dataframe. """ df = STSB_Dataset('../data/stsbenchmark/sts-test.csv').as_dataframe Loading @@ -148,6 +159,10 @@ def mask_first_token(): def mask_root(): """ For every sentence in the dataframe, mask the token which is the root in that sentences dependency tree. Return the changed dataframe. """ df = STSB_Dataset('../data/stsbenchmark/sts-test.csv').as_dataframe Loading Loading
src/probing.py +17 −2 Changes for src/probing.py: 17 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -66,8 +66,12 @@ def get_random_string(length): result_str = ''.join(random.choice(letters) for i in range(length)) return result_str def mask_token(pos_tag): def mask_token(pos_tag): """ For every sentence in the dataframe, mask that token whose POS matches the formal parameter and is also the highest in the dependency tree's structure. Return the changed dataframe. """ df = STSB_Dataset('../data/stsbenchmark/sts-test.csv').as_dataframe for e in range(len(dependency_hierarchy1)): Loading Loading @@ -95,7 +99,10 @@ def mask_token(pos_tag): def mask_first(pos_tag): """ For every sentence in the dataframe, mask that token whose POS matches the formal parameter. Return the changed dataframe. """ df = STSB_Dataset('../data/stsbenchmark/sts-test.csv').as_dataframe i = -1 Loading Loading @@ -127,6 +134,10 @@ def mask_first(pos_tag): def mask_first_token(): """ For every sentence in the dataframe, mask the first token. Return the changed dataframe. """ df = STSB_Dataset('../data/stsbenchmark/sts-test.csv').as_dataframe Loading @@ -148,6 +159,10 @@ def mask_first_token(): def mask_root(): """ For every sentence in the dataframe, mask the token which is the root in that sentences dependency tree. Return the changed dataframe. """ df = STSB_Dataset('../data/stsbenchmark/sts-test.csv').as_dataframe Loading