Skip to content

Commit a3513bf

Browse files
committed
sentiment processor has a specific way of loading the args, different from the standard UDProcessor
1 parent 3ebc831 commit a3513bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stanza/pipeline/sentiment_processor.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ def _set_up_model(self, config, pipeline, device):
6060
# batch size counted as words
6161
self._batch_size = config.get('batch_size', SentimentProcessor.DEFAULT_BATCH_SIZE)
6262

63+
def _set_up_final_config(self, config):
64+
loaded_args = vars(self._model.config)
65+
loaded_args = {k: v for k, v in loaded_args.items() if not UDProcessor.filter_out_option(k)}
66+
loaded_args.update(config)
67+
self._config = loaded_args
68+
69+
6370
def process(self, document):
6471
sentences = self._model.extract_sentences(document)
6572
with torch.no_grad():

0 commit comments

Comments
 (0)