Skip to content

Pass extra Stanza arguments through StanzaAsSpacy - #1

Open
Agnieszkachr wants to merge 1 commit into
SphRbtHyk:mainfrom
Agnieszkachr:patch-1
Open

Agnieszkachr wants to merge 1 commit into
SphRbtHyk:mainfrom
Agnieszkachr:patch-1

Conversation

@Agnieszkachr

Copy link
Copy Markdown

Thank you for releasing ALMA together with the data and benchmarking scripts! It is a very useful tool, and it was easy to reproduce your Greek results with it.

CollationALMA creates the tagger with StanzaAsSpacy(**stanza_config). StanzaAsSpacy.__init__ collects the remaining keys in **kwargs, and both its docstring and the README (where stanza_config is described as a "Configuration dict forwarded to Stanza") say they are passed to the Stanza pipeline, but stanza.Pipeline was called with lang, processors and use_gpu only. Keys such as lemma_model_path and pos_model_path were therefore silently ignored, and Stanza loaded its default model for the language.

In practice, with the Greek configuration in paper/benchmarking/benchmarking.py:

  • lemma_model_path and pos_model_path point to ../../stanza_models/grc_proielnodia_lemmatizer.pt and grc_proielnodia_tagger.pt, but these models are never loaded; the lemma and POS steps of ALMA run with Stanza's default Ancient Greek model instead, which expects accented text;
  • no error is raised, even when the files in stanza_models are missing: I noticed the issue because the benchmark ran without them and reproduced the Greek means in paper/results/john_greek_all_res_mean.csv;
  • SimAlign and ALMA with no_parse=True are not affected, since they do not use Stanza.

This one-line change forwards **kwargs to stanza.Pipeline.

Note: stanza_models is listed in .gitignore, so these files are not in the repository. With this change they need to be present locally, otherwise Stanza will raise a missing-file error.

Forward **kwargs from stanza_config to stanza.Pipeline, so that settings such as lemma_model_path and pos_model_path are no longer ignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant