Skip to content

LambdaExpression processor implemetation#136

Merged
ssh-meister merged 11 commits intomainfrom
LambdaExpression
Jul 18, 2025
Merged

LambdaExpression processor implemetation#136
ssh-meister merged 11 commits intomainfrom
LambdaExpression

Conversation

@ssh-meister
Copy link
Collaborator

@ssh-meister ssh-meister commented Jul 2, 2025

Added a new LambdaExpression processor that enables flexible and configurable data transformation or filtering via safe Python expressions. It evaluates expressions per entry using AST-based evaluation, supports dynamic field computation, and allows conditional entry filtering.

Application examples:

Misc:

  • added build to .gitignore (which appears during pip install .)
  • fixed warnings in SubRegex tests (DeprecationWarning: invalid escape sequence '\s' and '\d' appear because in Python strings with a backslash () the interpreter expects a special character, e.g., \n, \t, \, etc.)
  • removed unused imports in data_to_data.py

ssh-meister and others added 7 commits July 2, 2025 04:03
Signed-off-by: Sasha Meister <ameister@nvidia.com>
Signed-off-by: Sasha Meister <ameister@nvidia.com>
Signed-off-by: Sasha Meister <117230141+ssh-meister@users.noreply.github.com>
Signed-off-by: Sasha Meister <117230141+ssh-meister@users.noreply.github.com>
Signed-off-by: Sasha Meister <117230141+ssh-meister@users.noreply.github.com>
@ssh-meister ssh-meister self-assigned this Jul 4, 2025
docs/src/conf.py Outdated
"nemo",
"nemo.collections",
"nemo.collections.asr",
"nemo_text_processing",
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this used?

variables = {}

def _eval(node):
if isinstance(node, ast.Expression):
Copy link
Collaborator

@lilithgrigoryan lilithgrigoryan Jul 4, 2025

Choose a reason for hiding this comment

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

Let's rewrite this with python match and case instead of having multiple if-elses

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@lilithgrigoryan
Copy link
Collaborator

Thanks for the PR. Added comments above!

ssh-meister and others added 3 commits July 18, 2025 05:06
Signed-off-by: Sasha Meister <ameister@nvidia.com>
Signed-off-by: Sasha Meister <ameister@nvidia.com>
@ssh-meister ssh-meister merged commit ade63ff into main Jul 18, 2025
10 checks passed
@ssh-meister ssh-meister deleted the LambdaExpression branch July 18, 2025 15:17
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

Comments