Skip to content

Commit

Permalink
sentiment processor has a specific way of loading the args, different…
Browse files Browse the repository at this point in the history
… from the standard UDProcessor
  • Loading branch information
AngledLuffa committed Oct 27, 2024
1 parent 3ebc831 commit a3513bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions stanza/pipeline/sentiment_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ def _set_up_model(self, config, pipeline, device):
# batch size counted as words
self._batch_size = config.get('batch_size', SentimentProcessor.DEFAULT_BATCH_SIZE)

def _set_up_final_config(self, config):
loaded_args = vars(self._model.config)
loaded_args = {k: v for k, v in loaded_args.items() if not UDProcessor.filter_out_option(k)}
loaded_args.update(config)
self._config = loaded_args


def process(self, document):
sentences = self._model.extract_sentences(document)
with torch.no_grad():
Expand Down

0 comments on commit a3513bf

Please sign in to comment.