LanguageSpec#

class scikitplot.cleanprompt.LanguageSpec(code, name, genre, sizes)[source]#

One language spaCy publishes models for.

Parameters:
codestr

ISO 639-1 code.

namestr

English name of the language, for help text and reports.

genrestr

"web" or "news"; part of the model name.

sizestuple of str

Sizes actually published for this language.

Parameters:
code: str[source]#
genre: str[source]#
model_for(size)[source]#

Return the model name for size, falling back to the nearest.

Parameters:
sizestr

Preferred size.

Returns:
str

A model name this language actually publishes.

Parameters:

size (str)

Return type:

str

Notes

Developer notes. Falls back downwards to the largest available size no bigger than the request, and only upwards when nothing smaller exists. Asking for lg on a language that publishes only sm should get sm, not a name that does not resolve.

name: str[source]#
sizes: tuple[str, ...][source]#