Closed ahmedkooli closed 8 months ago
Hi @ahmedkooli, thanks for raising this issue!
Digging into this, it seems this is coming from argparser itself, and is due to this line. As the option text_column_names
starts with text_column_na
and it's selected.
For example - just using argparser:
>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', default=None)
>>> parser.parse_args(['--fo', 'a'])
Namespace(foo='a')
Thanks for the answer :) Would you suggest trying to enforce it in the transformers library or should I take the discussion up in the python repo directly?
@ahmedkooli As it's not something that we've encountered causing issues for our users, enforcing this isn't a feature we'd add at the moment. If it becomes something that is requested by many people (I'll measure as 👍 on this comment) or is a common pain point then we can revisit.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
System Info
transformers
version: 4.35.2Who can help?
No response
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
While running
examples/pytorch/text-classification/run_classification.py
, I noticed that the argument parser does not match the exact keywords, but rather a substring of the expected keyword. For example, running:works, whereas the argument
text_column_na
doesn't exist, and it replacestext_column_names
. Is this meant to be? I think this can lead to unexpected behaviours. Thanks in advance.Expected behavior
I expected an error due to a non existing keyword, such as: