private Model resolveModelFrom(Language language) {
        // Disregard language if there is default model
        if (models.size() == 1 && models.containsKey(Language.UNKNOWN)) return models.get(Language.UNKNOWN);
        if (models.containsKey(language)) return models.get(language);
        throw new IllegalArgumentException("No WordPiece model for language " + language + " is configured");
    }
<p>Embeds text into a tensor.</p>

<p>If the tensor type is indexed 1-d (bound or unbound) this will return a tensor containing the token ids in the order
they were encountered in the text. If the dimension is bound and too large it will be zero padded, if too small
it will be truncated.</p>

<p>If the tensor is any other type IllegalArgumentException is thrown.</p>

@param text the text to segment. The text should be of a language using space-separated words.
@param context the context which specifies the language used to select a model
@return the list of zero or more token ids resulting from segmenting the input text
linguistics-components/src/main/java/com/yahoo/language/wordpiece/WordPieceEmbedder.java