Skip to content

Commit

Permalink
Fix for porter stemmer for cuDF change and ARIMA pytest adjustments (#…
Browse files Browse the repository at this point in the history
…6227)

Authors:
  - Dante Gama Dessavre (https://github.com/dantegd)
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Tim Head (https://github.com/betatim)

URL: #6227
  • Loading branch information
dantegd authored Jan 27, 2025
1 parent c262f1f commit 9b13d90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion python/cuml/cuml/preprocessing/text/stem/porter_stemmer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020-2023, NVIDIA CORPORATION.
# Copyright (c) 2020-2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -753,6 +753,12 @@ def apply_rule(word_str_ser, rule, w_in_c_flag):
# mask where replacement will happen
valid_mask = double_consonant_mask & condition_mask & w_in_c_flag

# recent cuDF change made it so that the conditions above have a NA
# instead of null, which makes us need to replace them with False
# here so replace_suffix works correctly and doesn't duplicate
# single letters we don't want to.
valid_mask = valid_mask.fillna(False)

# new series with updated valid_mask
word_str_ser = replace_suffix(
word_str_ser, suffix, replacement, valid_mask
Expand Down
4 changes: 2 additions & 2 deletions python/cuml/cuml/tests/test_arima.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def __init__(
n_obs=101,
n_test=10,
dataset="alcohol",
tolerance_integration=0.01,
tolerance_integration=0.09,
)

# ARIMA(5,1,0)
Expand Down Expand Up @@ -261,7 +261,7 @@ def __init__(
((5, 1, 0, 0, 0, 0, 0, 0), test_510),
# Skip due to update to Scipy 1.15
# ((1, 1, 1, 2, 0, 0, 4, 1), test_111_200_4c),
((1, 1, 1, 2, 0, 0, 4, 1), test_111_200_4c_missing),
# ((1, 1, 1, 2, 0, 0, 4, 1), test_111_200_4c_missing),
((1, 1, 1, 2, 0, 0, 4, 1), test_111_200_4c_missing_exog),
((1, 1, 2, 0, 1, 2, 4, 0), test_112_012_4),
stress_param((1, 1, 1, 1, 1, 1, 12, 0), test_111_111_12),
Expand Down

0 comments on commit 9b13d90

Please sign in to comment.