Beispiel #1
0
    def _load_fasttext_model(self, model_file):
        if self._already_loaded:
            return

        from fasttext import load_model

        logger.info(f"Loading fasttext model now from {model_file}")

        self.model = load_model(model_file)
        # String to Vector
        self.stov = WordToVectorDict(self.model)
        logger.info("Finished loading fasttext model")

        self._already_loaded = True
Beispiel #2
0
    def _load_fasttext_model(self, model_file):
        if self._already_loaded:
            return

        from fasttext import load_model

        self.writer.write("Loading fasttext model now from %s" % model_file)

        self.model = load_model(model_file)
        # String to Vector
        self.stov = WordToVectorDict(self.model)
        self.writer.write("Finished loading fasttext model")

        self._already_loaded = True