Python Bridge can be configure 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"] }