Skip to content

Renaming TextEncoder -> LLMEncoder - #2255

Open
rcap107 wants to merge 3 commits into
skrub-data:mainfrom
rcap107:rename-textencoder
Open

Renaming TextEncoder -> LLMEncoder#2255
rcap107 wants to merge 3 commits into
skrub-data:mainfrom
rcap107:rename-textencoder

Conversation

@rcap107

@rcap107 rcap107 commented Aug 27, 2026

Copy link
Copy Markdown
Member

This PR renames the TextEncoder to LLMEncoder.

I renamed all instances of TextEncoder (with the exception of what's in the changelog), added a deprecation warning and the relative test.

Since I had to modify the content of the _text_encoder.py file, I thought it would be better to first merge this PR and then open a separate PR to rename the file, to keep the diff simple.

@rcap107 rcap107 added this to the Release 0.11 milestone Aug 27, 2026

@GaelVaroquaux GaelVaroquaux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, but that may be of importance

Comment thread skrub/_text_encoder.py
Comment on lines +457 to +476
class TextEncoder(LLMEncoder):
"""
Deprecated: Use :class:`~skrub.LLMEncoder` instead.

.. deprecated:: 0.11
The ``TextEncoder`` has been renamed to ``LLMEncoder``, and will be removed
in a future release.

"""

def __init__(self, *args, **kwargs):
import warnings

warnings.warn(
"TextEncoder is deprecated and will be removed in a future release. "
"Use LLMEncoder instead.",
DeprecationWarning,
stacklevel=2,
)
super().__init__(*args, **kwargs)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better way of doing this is to use the deprecated decorator of scikit-learn: https://scikit-learn.org/stable/modules/generated/sklearn.utils.deprecated.html
Something like:

Suggested change
class TextEncoder(LLMEncoder):
"""
Deprecated: Use :class:`~skrub.LLMEncoder` instead.
.. deprecated:: 0.11
The ``TextEncoder`` has been renamed to ``LLMEncoder``, and will be removed
in a future release.
"""
def __init__(self, *args, **kwargs):
import warnings
warnings.warn(
"TextEncoder is deprecated and will be removed in a future release. "
"Use LLMEncoder instead.",
DeprecationWarning,
stacklevel=2,
)
super().__init__(*args, **kwargs)
@deprecated("TextEncoder has been renamed to LLMEncoder and will be removed in version 0.12.")
class TextEncoder(LLMEncoder):
pass

I believe that this is important to avoid the use of "*args, **kwargs", which don't play well with our detection of arguments for get_params/set_params

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.

2 participants