Python Bridge can be configured using the config.json file in the config folder:
{ "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 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
Each type of model is constructed with an specific structure:
"Model_Type" : { "Model_Name": ["name1", "name2", "name3"] }
A model can be retrain, or a new model can be generated using the same algorithm with different parameters, so it could be said every single one of those parameters is a different version, each one of this versions can be stored in folders inside the model_name folder. An example of the directory tree and how each folder is named can be seen below
models_data │ ├───Model_Name │ ├───name1 │ | ├───1 │ | ├───2 │ | └───3 │ ├───name2 │ | ├───1 │ | └───2 │ └───name3 │ └───1 ├───LatentSemanticIndexing │ └───lsi │ ├───1 │ └───2 ├───SentimentAnalysisTextBlob │ └───textBlob │ └───1 ├───SentimentAnalysisVader │ └───vader │ └───1 └───TfidfVectorizer └───tfidf └───1