mirror of
				https://github.com/qurator-spk/sbb_ner.git
				synced 2025-11-04 03:24:14 +01:00 
			
		
		
		
	enable per model choice of training epoch;make config file exchangeable
This commit is contained in:
		
							parent
							
								
									54edcbc44d
								
							
						
					
					
						commit
						a5e5af2196
					
				
					 2 changed files with 6 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -18,7 +18,7 @@ from pytorch_pretrained_bert.modeling import (CONFIG_NAME,
 | 
			
		|||
 | 
			
		||||
app = Flask(__name__)
 | 
			
		||||
 | 
			
		||||
app.config.from_json('config.json')
 | 
			
		||||
app.config.from_json('config.json' if not os.environ.get('CONFIG') else os.environ.get('CONFIG'))
 | 
			
		||||
 | 
			
		||||
logger = logging.getLogger(__name__)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -161,7 +161,7 @@ class PredictorStore:
 | 
			
		|||
        if self._model_id != model_id:
 | 
			
		||||
 | 
			
		||||
            self._predictor = NERPredictor(model_dir=model['model_dir'],
 | 
			
		||||
                                           epoch=app.config['EPOCH'],
 | 
			
		||||
                                           epoch=model['epoch'],
 | 
			
		||||
                                           batch_size=app.config['BATCH_SIZE'],
 | 
			
		||||
                                           no_cuda=False if not os.environ.get('USE_CUDA') else
 | 
			
		||||
                                           os.environ.get('USE_CUDA').lower() == 'false')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,30 +1,33 @@
 | 
			
		|||
{
 | 
			
		||||
  "DATA_PATH": "data/digisam/fulltext.sqlite3",
 | 
			
		||||
  "EPOCH": 7,
 | 
			
		||||
  "BATCH_SIZE": 256,
 | 
			
		||||
  "MODELS": [
 | 
			
		||||
    {
 | 
			
		||||
      "name": "DC-SBB + CONLL + GERMEVAL",
 | 
			
		||||
      "id": 1,
 | 
			
		||||
      "model_dir": "data/konvens2019/build-wd_0.03/bert-all-german-de-finetuned",
 | 
			
		||||
      "epoch": 7,
 | 
			
		||||
      "default": true
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "name": "DC-SBB + CONLL + GERMEVAL + SBB",
 | 
			
		||||
      "id": 2,
 | 
			
		||||
      "model_dir": "data/konvens2019/build-on-all-german-de-finetuned/bert-sbb-de-finetuned",
 | 
			
		||||
      "epoch": 7,
 | 
			
		||||
      "default": false
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "name": "DC-SBB + SBB",
 | 
			
		||||
      "id": 3,
 | 
			
		||||
      "model_dir": "data/konvens2019/build-wd_0.03/bert-sbb-de-finetuned",
 | 
			
		||||
      "epoch": 7,
 | 
			
		||||
      "default": false
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "name": "CONLL + GERMEVAL",
 | 
			
		||||
      "id": 4,
 | 
			
		||||
      "model_dir": "data/konvens2019/build-wd_0.03/bert-all-german-baseline",
 | 
			
		||||
      "epoch": 7,
 | 
			
		||||
      "default": false
 | 
			
		||||
    }
 | 
			
		||||
  ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue