Filename tweak
# This task simply loads the specified file: useful for quick tests without
# setting up a new task.
-from parlai.core.teachers import FbDialogTeacher, ParlAIDialogTeacher
-
import copy
+import os
+
+from parlai.core.teachers import FbDialogTeacher, ParlAIDialogTeacher
class FbformatTeacher(FbDialogTeacher):
@@ -81,7 +82,9 @@ class ParlaiformatTeacher(ParlAIDialogTeacher):
datafile += "_" + self.opt['datatype'].split(':')[0] + '.txt'
if shared is None:
self._setup_data(datafile)
- self.id = datafile
+ # Truncate datafile to just the immediate enclosing folder name and file name
+ dirname, basename = os.path.split(datafile)
+ self.id = os.path.join(os.path.split(dirname)[1], basename)
self.reset()
