Example #1
0
 def saveGloveConfig(self):
     self.glove_path = self.glove_path_input.value
     self.glove_vocab = self.glove_vocab_input.value
     self.glove_vector = self.glove_vector_input.value
     self.workflow.glove_path = self.glove_path
     ConfigReader.setValue("glove/vocab", int(self.glove_vocab))
     ConfigReader.setValue("glove/vector", int(self.glove_vector))
     ConfigReader.setValue("glove/model_path", self.glove_path)
     ConfigReader.saveConfig()
     pass
 def loadDefaultConfig(self):
     if self.sources is None or len(self.sources) == 0:
         self.sources = ['SNOMEDCT_US']
         ConfigReader.setValue("umls/sources", self.sources)
     if self.filter_by_length is None:
         self.filter_by_length = 0
         ConfigReader.setValue("umls/filter_by_length", 0)
     if self.filter_by_contains is None:
         self.filter_by_contains = True
         ConfigReader.setValue("umls/filter_by_contains", True)
     if self.max_query is None:
         self.max_query = 50
         ConfigReader.setValue("umls/max_query", 50)
     ConfigReader.saveConfig()
     pass
    def complete(self):
        no_word_selected = True
        for type_name, toggle in self.to_umls_ext_filters.items():
            self.to_ext_words[type_name] = TreeSet(toggle.value)
            if no_word_selected and len(self.to_ext_words[type_name]) > 0:
                no_word_selected = False

        if not no_word_selected:
            self.workflow.to_ext_words = self.to_ext_words
            if self.api_key is None:
                self.api_key = self.api_input.value
                self.workflow.api_key = self.api_key
                ConfigReader.setValue("api_key", self.api_key)
                ConfigReader.saveConfig()
        else:
            self.setNextStep(self.workflow.steps[self.pos_id + 2])
            self.workflow.steps[self.pos_id + 2].setPreviousStep(self)
        super().complete()
        pass
Example #4
0
 def saveAPIKey(self):
     ConfigReader.setValue("api_key", self.api_key_input.value)
     ConfigReader.saveConfig()
     self.workflow.api_key = self.api_key_input.value
     pass