def process_console_input(self, entry):
        if self._file_preprocessor is None:
            file_path, file_name = BaseDataLoader._split_file_to_path_and_name(
                self.file_names[0])  # TODO: will be break with multiple filenames
            file_name = ConllPreprocessor.VOCABULARY_PREFIX + file_name
            self._file_preprocessor = ConllPreprocessor(file_path, file_name, self.field_delim,
                                                        self.DEFAULT_VOCABULARY_SIZE, self.DEFAULT_MAX_DATA_LENGTH)

        entry = self._file_preprocessor.preprocess_single_entry(entry)

        return entry
    def process_console_input(self, entry):
        if self._file_preprocessor is None:
            file_path, file_name = BaseDataLoader._split_file_to_path_and_name(
                self.file_names[0]
            )  # TODO: will be break with multiple filenames
            file_name = ConllPreprocessor.VOCABULARY_PREFIX + file_name
            self._file_preprocessor = ConllPreprocessor(
                file_path, file_name, self.field_delim,
                self.DEFAULT_VOCABULARY_SIZE, self.DEFAULT_MAX_DATA_LENGTH)

        entry = self._file_preprocessor.preprocess_single_entry(entry)

        return entry
Exemple #3
0
    def process_console_input(self, entry):
        if self.__file_preprocessor is None:
            voca_path, voca_name = BaseDataLoader._split_file_to_path_and_name(
                self.file_names[0]
            )  # TODO: will be break with multiple filenames
            voca_name = KagglePreprocessor.VOCABULARY_PREFIX + voca_name
            self.__file_preprocessor = KagglePreprocessor(
                voca_path, voca_name, self.field_delim,
                self.DEFAULT_VOCABULARY_SIZE, self.DEFAULT_MAX_DATA_LENGTH,
                self.DEFAULT_TEST_SPLIT)

        entry = self.__file_preprocessor.preprocess_single_entry(entry)

        return entry