Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Get a copy of the PB config file (config.json) or open an existing config file.
    1. This file can be found in the "config" folder of the Python Bridge binaries or from here:
      1. Code Block
        languagejs
        titleSAGA PB config file
        linenumberstrue
        collapsetrue
        {
            "host": "0.0.0.0",
            "port": 5000,
            "ssl": {
                "enabled": false,
                "secure_port": 5443,
                "certificate": {
                    "cert": "cert.pem",
                    "key": "key.pem"
                }
            },
            "authentication": {
                "enabled": false,
                "credentials": {
                    "user": "admin",
                    "password": "password"
                }
            },
            "threads": 30,
            "logging": {
                "level": "info",
                "loggers": {
                    "werkzeug": "info",
                    "gensim.utils": "warn",
                    "pytorch_pretrained_bert.modeling": "warn",
                    "pytorch_pretrained_bert.tokenization": "warn"
                }
            },
            "models_data_dir": "models_data",
            "model_types": {
                "Classification_watcher_example": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": ["Classification_watcher_example"],
                    "default_model": "Classification_watcher_example"
                },
                "LatentSemanticIndexing" : {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": ["lsi"]
                },
                "Bert": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": ["bert-base-uncased"],
                    "default_model": "bert-base-uncased"
                },
        	"BioBert": {
                     "enabled": false,
                     "input_data_as_tokens": false,
                     "model_names": ["biobert-base-cased-v1.2"],
                     "default_model": "biobert-base-cased-v1.2"
                },
                "BertQA": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": ["bert-large-uncased-whole-word-masking-finetuned-squad"],
                    "default_model": "bert-large-uncased-whole-word-masking-finetuned-squad"
                },
                "SBert": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": ["bert-base-nli-stsb-mean-tokens", "bert-base-nli-mean-tokens", "distilbert-base-nli-stsb-mean-tokens"],
                    "default_model": "bert-base-nli-stsb-mean-tokens"
                },
                "SentimentAnalysisVader": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": ["vader"]
                },
                "SentimentAnalysisTextBlob": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": ["textBlob"]
                },
                "TfidfVectorizer": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": ["Tfidf"]
                },
                "GTRT5": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": [
                        "gtr-t5-base",
        		        "gtr-t5-xl"
                    ],
        	        "default_model": "gtr-t5-base"
                },
                "T5": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": [
                        "sentence-t5-base"
                    ]
                },
        	    "MiniLM": {
                    "enabled": false,
                    "input_data_as_tokens": false,
                    "model_names": [
                        "all-MiniLM-L12-v2"
                    ]
                }
            }
        }
  2. The next step is to add your environmental variables in, you can enter any number of variables, the only condition is that the environment where the Python Bridge is going to be executed has the same env variables with the same names.
    1. Code Block
      languagejs
      titleSAGA PB config file
      linenumberstrue
      collapsetrue
      {
          "host": "${HOST}",
          "port": ${PORT},
          "ssl": {
              "enabled": ${SSL_ENABLED},
              "secure_port": ${SECURE_PORT},
      	... <REST_OF_CONFIG>
      }
      Note
      titleIMPORTANT

      For the values in the config file that comes with quotes, you need to add env variable replace value inside those quotes or add the quotes to the env var.

  3. Replace the default config file with the new one with the env variables and run the Python Bridge.

...