Skip to content

Commit

Permalink
rename demonstrative_noun to determiner_noun
Browse files Browse the repository at this point in the history
  • Loading branch information
phueb committed Jun 14, 2021
1 parent 303dccf commit b2af8d5
Show file tree
Hide file tree
Showing 45 changed files with 92,015 additions and 11 deletions.
Binary file modified images/exp1a_average.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/exp2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions scripts/plot_accuracy_boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
STEP = '*'
IS_LOCAL = True
REP = 0
PARAM_NAMES: Optional[List[str]] = None # [f'param_{i:03}' for i in [1, 2]]
CONDITIONS = ['leave_unmasked_prob', ]
PARAM_NAMES: Optional[List[str]] = [
'huggingface_Roberta-base_30B',
'huggingface_Roberta-base_10M',
'fairseq_Roberta-base_5M',
'huggingface_BabyBERTa_5M+standard-unmasking',
'huggingface_BabyBERTa_5M',
]
CONDITIONS = ['corpora', 'leave_unmasked_prob', ]

if IS_LOCAL:
configs.Eval.local_runs = True
Expand Down
7 changes: 2 additions & 5 deletions zorro/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def get_phenomena_and_paradigms(excluded_paradigms: Optional[List[str]] = None,
# 4
'agreement_subject_verb',
# 2
'agreement_demonstrative_subject',
'agreement_determiner_noun',
'filler-gap',
'island-effects',
'quantifiers',
Expand Down Expand Up @@ -205,15 +205,12 @@ def get_legend_label(group_name,
res = res.replace("corpora=('wikipedia1', 'wikipedia2', 'wikipedia3')", 'Wiki-1 + Wiki-2 + Wiki-3')
res = res.replace("corpora=('aochildes', 'aonewsela', 'wikipedia3')", 'AO-CHILDES + AO-Newsela + Wiki-3')

res = res.replace("corpora=('aochildes',)", 'AO-CHILDES')
res = res.replace("corpora=('aonewsela',)", 'AO-Newsela')
res = res.replace("corpora=('wikipedia1',)", 'Wikipedia-1')

res = res.replace("('aochildes',)", 'AO-CHILDES')
res = res.replace("('aonewsela',)", 'AO-Newsela')
res = res.replace("('wikipedia1',)", 'Wikipedia-1')

res = res.replace("data_size=", '')
res = res.replace("corpora=", '')

return res

Expand Down
9 changes: 5 additions & 4 deletions zorro/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def make_ax_title(name: str):
ax_title = ax_title.replace('structure', 'struct.')
ax_title = ax_title.replace('prepositional', 'prep.')
ax_title = ax_title.replace('agreement', 'agreem.')
ax_title = ax_title.replace('demonstrative', 'det.')
ax_title = ax_title.replace('determiner', 'det.')
return ax_title


Expand Down Expand Up @@ -505,9 +505,9 @@ def _plot_boxplot_summary_on_axis(self,

# x axis
x_ticks = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
ax.set_xlabel('Average Accuracy', fontsize=configs.Figs.ax_font_size)
ax.set_xlabel('Average Accuracy', fontsize=8)
ax.set_xticks(x_ticks)
ax.set_xticklabels(x_ticks, fontsize=configs.Figs.tick_font_size)
ax.set_xticklabels(x_ticks, fontsize=8)

# collect last_accuracy for each replication across all paradigms
gn2rep2accuracies_by_pd = defaultdict(dict)
Expand Down Expand Up @@ -539,7 +539,7 @@ def _plot_boxplot_summary_on_axis(self,
data_for_one_group = accuracies_by_pd_by_rep.mean(axis=0)
boxplot_data.append(data_for_one_group)
# boxplot plots IQR and line at median, not mean
positions = [n for n, _ in enumerate(group_names)]
positions = [n for n, _ in enumerate(group_names)][::-1]
box_plot = ax.boxplot(boxplot_data,
positions=positions,
vert=False,
Expand All @@ -548,6 +548,7 @@ def _plot_boxplot_summary_on_axis(self,
flierprops={'markersize': 2},
boxprops=dict(linewidth=1),
zorder=2,
showfliers = False,
)
# mark the mean
means = [np.mean(x) for x in boxplot_data]
Expand Down

0 comments on commit b2af8d5

Please sign in to comment.