From 3ca9f8b06c399801aea2a186c711c32ed614af21 Mon Sep 17 00:00:00 2001 From: yaoxuefeng Date: Tue, 2 Jun 2020 15:54:20 +0800 Subject: [PATCH] fix data preprocess bugs --- models/rank/dcn/data/get_slot_data.py | 2 +- models/rank/wide_deep/data/get_slot_data.py | 3 ++- models/rank/xdeepfm/data/get_slot_data.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/models/rank/dcn/data/get_slot_data.py b/models/rank/dcn/data/get_slot_data.py index 96d44482..b1adb028 100755 --- a/models/rank/dcn/data/get_slot_data.py +++ b/models/rank/dcn/data/get_slot_data.py @@ -59,7 +59,7 @@ class TrainReader(dg.MultiSlotDataGenerator): self.cat_feat_idx_dict_list = [{} for _ in range(26)] # TODO: set vocabulary dictionary - vocab_dir = "./vocab/" + vocab_dir = "./sample_data/vocab/" for i in range(26): lookup_idx = 1 # remain 0 for default value for line in open( diff --git a/models/rank/wide_deep/data/get_slot_data.py b/models/rank/wide_deep/data/get_slot_data.py index 831d0566..ec37f9af 100755 --- a/models/rank/wide_deep/data/get_slot_data.py +++ b/models/rank/wide_deep/data/get_slot_data.py @@ -11,7 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import yaml +import yaml, os + from paddlerec.core.reader import Reader from paddlerec.core.utils import envs try: diff --git a/models/rank/xdeepfm/data/get_slot_data.py b/models/rank/xdeepfm/data/get_slot_data.py index 4426e964..0ace10b4 100755 --- a/models/rank/xdeepfm/data/get_slot_data.py +++ b/models/rank/xdeepfm/data/get_slot_data.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import yaml +import yaml, os from paddlerec.core.reader import Reader from paddlerec.core.utils import envs try: -- GitLab