Skip to content

Commit

Permalink
[HotFix] ArcII model name.
Browse files Browse the repository at this point in the history
  • Loading branch information
pl8787 committed Jan 5, 2019
1 parent c7692f2 commit dd0271c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion matchzoo/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .cdssm_model import CDSSMModel
from .dense_baseline_model import DenseBaselineModel
from .arci_model import ArcI
from .arcii_model import ArcIIModel
from .arcii import ArcII
from .match_pyramid import MatchPyramid
from .knrm_model import KNRM
from .conv_knrm_model import ConvKNRM
Expand Down
4 changes: 2 additions & 2 deletions matchzoo/models/arcii_model.py → matchzoo/models/arcii.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from matchzoo import engine


class ArcIIModel(engine.BaseModel):
class ArcII(engine.BaseModel):
"""
ArcII Model.
Examples:
>>> model = ArcIIModel()
>>> model = ArcII()
>>> model.params['embedding_output_dim'] = 300
>>> model.params['num_blocks'] = 2
>>> model.params['kernel_1d_count'] = 32
Expand Down
88 changes: 44 additions & 44 deletions notebooks/wikiqa/arcii.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"source": [
"import sys\n",
"sys.path.insert(0, '../')\n",
"sys.path.insert(0, '../../')\n",
"import keras\n",
"import pandas as pd\n",
"import numpy as np\n",
Expand All @@ -42,23 +42,23 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Processing text_left with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 2118/2118 [00:00<00:00, 9204.73it/s]\n",
"Processing text_right with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 18841/18841 [00:03<00:00, 5122.65it/s]\n",
"Processing text_right with append: 100%|██████████| 18841/18841 [00:00<00:00, 890571.72it/s]\n",
"Building FrequencyFilterUnit from a datapack.: 100%|██████████| 18841/18841 [00:00<00:00, 145556.91it/s]\n",
"Processing text_right with transform: 100%|██████████| 18841/18841 [00:00<00:00, 84253.04it/s]\n",
"Processing text_left with extend: 100%|██████████| 2118/2118 [00:00<00:00, 684771.13it/s]\n",
"Processing text_right with extend: 100%|██████████| 18841/18841 [00:00<00:00, 739760.18it/s]\n",
"Building VocabularyUnit from a datapack.: 100%|██████████| 404432/404432 [00:00<00:00, 3118011.96it/s]\n",
"Processing text_left with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 2118/2118 [00:00<00:00, 9439.29it/s]\n",
"Processing text_right with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 18841/18841 [00:03<00:00, 4995.98it/s]\n",
"Processing text_right with transform: 100%|██████████| 18841/18841 [00:00<00:00, 132960.63it/s]\n",
"Processing text_left with transform: 100%|██████████| 2118/2118 [00:00<00:00, 212169.47it/s]\n",
"Processing text_right with transform: 100%|██████████| 18841/18841 [00:00<00:00, 113856.07it/s]\n",
"Processing length_left with len: 100%|██████████| 2118/2118 [00:00<00:00, 649096.59it/s]\n",
"Processing length_right with len: 100%|██████████| 18841/18841 [00:00<00:00, 809200.29it/s]\n",
"Processing text_left with transform: 100%|██████████| 2118/2118 [00:00<00:00, 117751.63it/s]\n",
"Processing text_right with transform: 100%|██████████| 18841/18841 [00:00<00:00, 94513.35it/s]\n"
"Processing text_left with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 2118/2118 [00:00<00:00, 8051.51it/s]\n",
"Processing text_right with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 18841/18841 [00:03<00:00, 5193.22it/s]\n",
"Processing text_right with append: 100%|██████████| 18841/18841 [00:00<00:00, 851047.66it/s]\n",
"Building FrequencyFilterUnit from a datapack.: 100%|██████████| 18841/18841 [00:00<00:00, 142854.09it/s]\n",
"Processing text_right with transform: 100%|██████████| 18841/18841 [00:00<00:00, 91108.51it/s]\n",
"Processing text_left with extend: 100%|██████████| 2118/2118 [00:00<00:00, 702866.99it/s]\n",
"Processing text_right with extend: 100%|██████████| 18841/18841 [00:00<00:00, 716161.87it/s]\n",
"Building VocabularyUnit from a datapack.: 100%|██████████| 404432/404432 [00:00<00:00, 2963650.83it/s]\n",
"Processing text_left with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 2118/2118 [00:00<00:00, 9625.60it/s]\n",
"Processing text_right with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 18841/18841 [00:03<00:00, 5226.32it/s]\n",
"Processing text_right with transform: 100%|██████████| 18841/18841 [00:00<00:00, 146729.85it/s]\n",
"Processing text_left with transform: 100%|██████████| 2118/2118 [00:00<00:00, 241459.48it/s]\n",
"Processing text_right with transform: 100%|██████████| 18841/18841 [00:00<00:00, 130413.99it/s]\n",
"Processing text_left with transform: 100%|██████████| 2118/2118 [00:00<00:00, 143602.47it/s]\n",
"Processing text_right with transform: 100%|██████████| 18841/18841 [00:00<00:00, 106276.38it/s]\n",
"Processing length_left with len: 100%|██████████| 2118/2118 [00:00<00:00, 650474.91it/s]\n",
"Processing length_right with len: 100%|██████████| 18841/18841 [00:00<00:00, 793773.17it/s]\n"
]
}
],
Expand All @@ -78,24 +78,24 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Processing text_left with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 122/122 [00:00<00:00, 8113.42it/s]\n",
"Processing text_right with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 1115/1115 [00:00<00:00, 5061.39it/s]\n",
"Processing text_right with transform: 100%|██████████| 1115/1115 [00:00<00:00, 131993.14it/s]\n",
"Processing text_left with transform: 100%|██████████| 122/122 [00:00<00:00, 102300.10it/s]\n",
"Processing text_right with transform: 100%|██████████| 1115/1115 [00:00<00:00, 134428.96it/s]\n",
"Processing length_left with len: 100%|██████████| 122/122 [00:00<00:00, 162807.85it/s]\n",
"Processing length_right with len: 100%|██████████| 1115/1115 [00:00<00:00, 575658.41it/s]\n",
"Processing text_left with transform: 100%|██████████| 122/122 [00:00<00:00, 78905.95it/s]\n",
"Processing text_right with transform: 100%|██████████| 1115/1115 [00:00<00:00, 95527.60it/s]\n",
"Processing text_left with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 237/237 [00:00<00:00, 8272.03it/s]\n",
"Processing text_right with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 2300/2300 [00:00<00:00, 3997.12it/s]\n",
"Processing text_right with transform: 100%|██████████| 2300/2300 [00:00<00:00, 125767.88it/s]\n",
"Processing text_left with transform: 100%|██████████| 237/237 [00:00<00:00, 136996.97it/s]\n",
"Processing text_right with transform: 100%|██████████| 2300/2300 [00:00<00:00, 147700.33it/s]\n",
"Processing length_left with len: 100%|██████████| 237/237 [00:00<00:00, 284420.61it/s]\n",
"Processing length_right with len: 100%|██████████| 2300/2300 [00:00<00:00, 725821.92it/s]\n",
"Processing text_left with transform: 100%|██████████| 237/237 [00:00<00:00, 97018.35it/s]\n",
"Processing text_right with transform: 100%|██████████| 2300/2300 [00:00<00:00, 92974.99it/s]\n"
"Processing text_left with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 122/122 [00:00<00:00, 9297.47it/s]\n",
"Processing text_right with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 1115/1115 [00:00<00:00, 5304.89it/s]\n",
"Processing text_right with transform: 100%|██████████| 1115/1115 [00:00<00:00, 153141.95it/s]\n",
"Processing text_left with transform: 100%|██████████| 122/122 [00:00<00:00, 133569.59it/s]\n",
"Processing text_right with transform: 100%|██████████| 1115/1115 [00:00<00:00, 139588.96it/s]\n",
"Processing text_left with transform: 100%|██████████| 122/122 [00:00<00:00, 89380.80it/s]\n",
"Processing text_right with transform: 100%|██████████| 1115/1115 [00:00<00:00, 111870.85it/s]\n",
"Processing length_left with len: 100%|██████████| 122/122 [00:00<00:00, 236571.93it/s]\n",
"Processing length_right with len: 100%|██████████| 1115/1115 [00:00<00:00, 586046.24it/s]\n",
"Processing text_left with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 237/237 [00:00<00:00, 9509.62it/s]\n",
"Processing text_right with chain_transform of TokenizeUnit => LowercaseUnit => PuncRemovalUnit: 100%|██████████| 2300/2300 [00:00<00:00, 4458.92it/s]\n",
"Processing text_right with transform: 100%|██████████| 2300/2300 [00:00<00:00, 152645.64it/s]\n",
"Processing text_left with transform: 100%|██████████| 237/237 [00:00<00:00, 179334.30it/s]\n",
"Processing text_right with transform: 100%|██████████| 2300/2300 [00:00<00:00, 152092.12it/s]\n",
"Processing text_left with transform: 100%|██████████| 237/237 [00:00<00:00, 122828.38it/s]\n",
"Processing text_right with transform: 100%|██████████| 2300/2300 [00:00<00:00, 109828.53it/s]\n",
"Processing length_left with len: 100%|██████████| 237/237 [00:00<00:00, 298692.92it/s]\n",
"Processing length_right with len: 100%|██████████| 2300/2300 [00:00<00:00, 702768.21it/s]\n"
]
}
],
Expand Down Expand Up @@ -129,7 +129,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Parameter \"name\" set to ArcIIModel.\n",
"Parameter \"name\" set to ArcII.\n",
"__________________________________________________________________________________________________\n",
"Layer (type) Output Shape Param # Connected to \n",
"==================================================================================================\n",
Expand Down Expand Up @@ -165,7 +165,7 @@
}
],
"source": [
"model = mz.models.ArcIIModel()\n",
"model = mz.models.ArcII()\n",
"model.params['input_shapes'] = preprocessor.context['input_shapes']\n",
"model.params['task'] = ranking_task\n",
"model.params['embedding_input_dim'] = preprocessor.context['vocab_size'] + 1\n",
Expand Down Expand Up @@ -252,14 +252,14 @@
"output_type": "stream",
"text": [
"Epoch 1/3\n",
"102/102 [==============================] - 2s 16ms/step - loss: 0.6989\n",
"Validation: loss:nan - normalized_discounted_cumulative_gain@3(0):0.525158 - normalized_discounted_cumulative_gain@5(0):0.584905 - mean_average_precision(0):0.541072\n",
"102/102 [==============================] - 2s 16ms/step - loss: 0.6383\n",
"Validation: loss:nan - normalized_discounted_cumulative_gain@3(0):0.552099 - normalized_discounted_cumulative_gain@5(0):0.622490 - mean_average_precision(0):0.576884\n",
"Epoch 2/3\n",
"102/102 [==============================] - 2s 18ms/step - loss: 0.3547\n",
"Validation: loss:nan - normalized_discounted_cumulative_gain@3(0):0.491527 - normalized_discounted_cumulative_gain@5(0):0.564802 - mean_average_precision(0):0.522820\n",
"102/102 [==============================] - 2s 18ms/step - loss: 0.3246\n",
"Validation: loss:nan - normalized_discounted_cumulative_gain@3(0):0.531595 - normalized_discounted_cumulative_gain@5(0):0.595254 - mean_average_precision(0):0.556973\n",
"Epoch 3/3\n",
"102/102 [==============================] - 2s 21ms/step - loss: 0.1788\n",
"Validation: loss:nan - normalized_discounted_cumulative_gain@3(0):0.501231 - normalized_discounted_cumulative_gain@5(0):0.570541 - mean_average_precision(0):0.530823\n"
"102/102 [==============================] - 2s 18ms/step - loss: 0.1632\n",
"Validation: loss:nan - normalized_discounted_cumulative_gain@3(0):0.518716 - normalized_discounted_cumulative_gain@5(0):0.593164 - mean_average_precision(0):0.552022\n"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion notebooks/wikiqa/matchpyramid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"source": [
"import sys\n",
"sys.path.insert(0, '../')\n",
"sys.path.insert(0, '../../')\n",
"import keras\n",
"import pandas as pd\n",
"import numpy as np\n",
Expand Down

0 comments on commit dd0271c

Please sign in to comment.