Example #1
0
    def get_data_and_label(self):
        self.get_files()
        nlp = NLP(None)
        nlp.set_stop_words()
        file_reader = FileReader(None)
        contents = []
        labels = []

        #init titles
        titles = {}
        for title in self.files:
            titles[title] = con.get_setting('labels', str(title))

        for title in self.files:
            for file in self.files[title]:
                file_reader.file_path = file
                nlp.text = file_reader.read()

                contents.append(nlp.get_words_feature())
                labels.append(titles[title])

        return (contents, labels)
Example #2
0
 def __init__(self, kubeadm_config_template_path: str, token_path: str):
     self.__kubeadm_config_template_path = kubeadm_config_template_path
     self.__token = FileReader().execute(token_path)