You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Python Bridge can be configure using the config.json file in the config folder:

Default Python Bridge Configuration
{
    "host": "0.0.0.0",
    "port": 5000,
    "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": {
        "LatentSemanticIndexing" : {
            "model_names": ["lsi"]
        },
        "Bert": {
            "model_names": ["bert-base-uncased"],
            "default_model": "bert-base-uncased"
        },
        "SentimentAnalysisVader": {
            "model_names": ["vader"]
        },
        "SentimentAnalysisTextBlob": {
            "model_names": ["textBlob"]
        }
    }
}


In Line 2, the  host ( type=string | default=0.0.0.0 | required ) - Identifies the host from which the service will listen to requests. By default the service accepts all request

Lines 3, the  port ( type=integer | default=5000 | required ) - Port in which the service will listen for requests

In Line 4 we can find the logging section, in this section can be specified the logging level for the root logger, and the level for specific loggers

  • Line 5  level ( type=string | default=info | required ) - Level of the root logger, and by extension all loggers without a set level
  • Line 6  loggers ( type=json | optional ) - section for specific loggers, each logger can be identified by its name and level (e.g."name": "level")

Line 13,  models_data_dir ( type=string | default=models_data | required ) - path to folder storing the models

Line 14,  model_types ( type=json | required ) - section holding the types of model to load. If a new type is added, it needs to be added here too

Model Type Structure

Each type of model is constructed with an specific structure:

"Model_Type" : {
  "Model_Name": ["name1", "name2", "name3"]
}
  • Model_Type ( type=json | optional ) - The model type indicates the type of logic to implement, (e.i. the name of the class)
    • model_names ( type=string array | optional ) - Holds the names of the actual models to implement. Each model is stored in a folder with the same name, inside the models_data folder, it makes a path line "models_data\ModeL_Name\name1"
  • No labels