Skip to content

Commit

Permalink
fix bugs in naqanet (allenai#2604)
Browse files Browse the repository at this point in the history
  • Loading branch information
haonan-li authored and TalSchuster committed Feb 20, 2020
1 parent 37c3c02 commit 75ad3ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions allennlp/models/reading_comprehension/naqanet.py
Expand Up @@ -94,7 +94,7 @@ def __init__(self, vocab: Vocabulary,
hidden_dims=[modeling_out_dim, 1],
num_layers=2)

if "question_span_extraction" in answering_abilities:
if "question_span_extraction" in self.answering_abilities:
self._question_span_extraction_index = self.answering_abilities.index("question_span_extraction")
self._question_span_start_predictor = FeedForward(modeling_out_dim * 2,
activations=[Activation.by_name('relu')(),
Expand All @@ -107,15 +107,15 @@ def __init__(self, vocab: Vocabulary,
hidden_dims=[modeling_out_dim, 1],
num_layers=2)

if "addition_subtraction" in answering_abilities:
if "addition_subtraction" in self.answering_abilities:
self._addition_subtraction_index = self.answering_abilities.index("addition_subtraction")
self._number_sign_predictor = FeedForward(modeling_out_dim * 3,
activations=[Activation.by_name('relu')(),
Activation.by_name('linear')()],
hidden_dims=[modeling_out_dim, 3],
num_layers=2)

if "counting" in answering_abilities:
if "counting" in self.answering_abilities:
self._counting_index = self.answering_abilities.index("counting")
self._count_number_predictor = FeedForward(modeling_out_dim,
activations=[Activation.by_name('relu')(),
Expand Down

0 comments on commit 75ad3ed

Please sign in to comment.