nextrec 0.2.2__py3-none-any.whl → 0.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nextrec/__version__.py +1 -1
- nextrec/basic/features.py +2 -1
- nextrec/basic/model.py +2 -2
- nextrec/data/__init__.py +2 -4
- nextrec/data/dataloader.py +3 -3
- nextrec/data/preprocessor.py +2 -2
- {nextrec-0.2.2.dist-info → nextrec-0.2.3.dist-info}/METADATA +2 -2
- {nextrec-0.2.2.dist-info → nextrec-0.2.3.dist-info}/RECORD +10 -10
- {nextrec-0.2.2.dist-info → nextrec-0.2.3.dist-info}/WHEEL +0 -0
- {nextrec-0.2.2.dist-info → nextrec-0.2.3.dist-info}/licenses/LICENSE +0 -0
nextrec/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.3"
|
nextrec/basic/features.py
CHANGED
|
@@ -83,7 +83,7 @@ class DenseFeature(BaseFeature):
|
|
|
83
83
|
self.embedding_dim = embedding_dim
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
class
|
|
86
|
+
class FeatureSpecMixin:
|
|
87
87
|
"""
|
|
88
88
|
Mixin that normalizes dense/sparse/sequence feature lists and target/id columns.
|
|
89
89
|
"""
|
|
@@ -116,3 +116,4 @@ class FeatureConfig:
|
|
|
116
116
|
if isinstance(value, str):
|
|
117
117
|
return [value]
|
|
118
118
|
return list(value)
|
|
119
|
+
|
nextrec/basic/model.py
CHANGED
|
@@ -19,7 +19,7 @@ from typing import Union, Literal
|
|
|
19
19
|
from torch.utils.data import DataLoader, TensorDataset
|
|
20
20
|
|
|
21
21
|
from nextrec.basic.callback import EarlyStopper
|
|
22
|
-
from nextrec.basic.features import DenseFeature, SparseFeature, SequenceFeature,
|
|
22
|
+
from nextrec.basic.features import DenseFeature, SparseFeature, SequenceFeature, FeatureSpecMixin
|
|
23
23
|
from nextrec.basic.metrics import configure_metrics, evaluate_metrics
|
|
24
24
|
|
|
25
25
|
from nextrec.loss import get_loss_fn, get_loss_kwargs
|
|
@@ -30,7 +30,7 @@ from nextrec.utils import get_optimizer, get_scheduler
|
|
|
30
30
|
from nextrec.basic.session import resolve_save_path, create_session
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
class BaseModel(
|
|
33
|
+
class BaseModel(FeatureSpecMixin, nn.Module):
|
|
34
34
|
@property
|
|
35
35
|
def model_name(self) -> str:
|
|
36
36
|
raise NotImplementedError
|
nextrec/data/__init__.py
CHANGED
|
@@ -18,9 +18,7 @@ from nextrec.data.data_utils import (
|
|
|
18
18
|
read_table,
|
|
19
19
|
load_dataframes,
|
|
20
20
|
)
|
|
21
|
-
from nextrec.basic.features import
|
|
22
|
-
|
|
23
|
-
# For backward compatibility, keep utils accessible
|
|
21
|
+
from nextrec.basic.features import FeatureSpecMixin
|
|
24
22
|
from nextrec.data import data_utils
|
|
25
23
|
|
|
26
24
|
__all__ = [
|
|
@@ -33,6 +31,6 @@ __all__ = [
|
|
|
33
31
|
'iter_file_chunks',
|
|
34
32
|
'read_table',
|
|
35
33
|
'load_dataframes',
|
|
36
|
-
'
|
|
34
|
+
'FeatureSpecMixin',
|
|
37
35
|
'data_utils',
|
|
38
36
|
]
|
nextrec/data/dataloader.py
CHANGED
|
@@ -17,7 +17,7 @@ from typing import Iterator, Literal, Union, Optional
|
|
|
17
17
|
|
|
18
18
|
from torch.utils.data import DataLoader, TensorDataset, IterableDataset
|
|
19
19
|
from nextrec.data.preprocessor import DataProcessor
|
|
20
|
-
from nextrec.basic.features import DenseFeature, SparseFeature, SequenceFeature,
|
|
20
|
+
from nextrec.basic.features import DenseFeature, SparseFeature, SequenceFeature, FeatureSpecMixin
|
|
21
21
|
|
|
22
22
|
from nextrec.basic.loggers import colorize
|
|
23
23
|
from nextrec.data import (
|
|
@@ -28,7 +28,7 @@ from nextrec.data import (
|
|
|
28
28
|
)
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
class FileDataset(
|
|
31
|
+
class FileDataset(FeatureSpecMixin, IterableDataset):
|
|
32
32
|
"""
|
|
33
33
|
Iterable dataset that streams CSV/Parquet files in chunks and yields tensor tuples.
|
|
34
34
|
|
|
@@ -164,7 +164,7 @@ class FileDataset(FeatureConfig, IterableDataset):
|
|
|
164
164
|
)
|
|
165
165
|
|
|
166
166
|
|
|
167
|
-
class RecDataLoader(
|
|
167
|
+
class RecDataLoader(FeatureSpecMixin):
|
|
168
168
|
"""
|
|
169
169
|
Convenience wrapper for building PyTorch ``DataLoader`` objects for recommendation models.
|
|
170
170
|
|
nextrec/data/preprocessor.py
CHANGED
|
@@ -31,9 +31,9 @@ from nextrec.data.data_utils import (
|
|
|
31
31
|
default_output_dir,
|
|
32
32
|
)
|
|
33
33
|
from nextrec.basic.session import create_session, resolve_save_path
|
|
34
|
-
from nextrec.basic.features import
|
|
34
|
+
from nextrec.basic.features import FeatureSpecMixin
|
|
35
35
|
|
|
36
|
-
class DataProcessor(
|
|
36
|
+
class DataProcessor(FeatureSpecMixin):
|
|
37
37
|
"""DataProcessor for data preprocessing including numeric, sparse, sequence features and target processing.
|
|
38
38
|
|
|
39
39
|
Examples:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nextrec
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: A comprehensive recommendation library with match, ranking, and multi-task learning models
|
|
5
5
|
Project-URL: Homepage, https://github.com/zerolovesea/NextRec
|
|
6
6
|
Project-URL: Repository, https://github.com/zerolovesea/NextRec
|
|
@@ -61,7 +61,7 @@ Description-Content-Type: text/markdown
|
|
|
61
61
|

|
|
62
62
|

|
|
63
63
|

|
|
64
|
-

|
|
65
65
|
|
|
66
66
|
English | [中文版](README_zh.md)
|
|
67
67
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
nextrec/__init__.py,sha256=CvocnY2uBp0cjNkhrT6ogw0q2bN9s1GNp754FLO-7lo,1117
|
|
2
|
-
nextrec/__version__.py,sha256=
|
|
2
|
+
nextrec/__version__.py,sha256=PNiDER4qM19h9zdsdfgKt2_dT4WgYK7EguJ8RU2qA_g,22
|
|
3
3
|
nextrec/basic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
nextrec/basic/activation.py,sha256=9EfYmwE0brTSKwx_0FIGQ_rybFBT9n_G-UWA7NAhMsI,2804
|
|
5
5
|
nextrec/basic/callback.py,sha256=qkq3k8rP0g4BW2C3FSCdVt_CyCcJwJ-rUXjhT2p4LP8,1035
|
|
6
|
-
nextrec/basic/features.py,sha256=
|
|
6
|
+
nextrec/basic/features.py,sha256=TJfJgzWuy68lBKOeCzztcUK3ZtjHhK8oSMs8k0vXGlg,3961
|
|
7
7
|
nextrec/basic/layers.py,sha256=mDNApSlPkmPSnIPj3BDHfDEjviLybWuSGrh61Zog2uk,38290
|
|
8
8
|
nextrec/basic/loggers.py,sha256=x8lzyyK-uqBN5XGOm1Cb33dmfc2bl114n6QeFTtE54k,3752
|
|
9
9
|
nextrec/basic/metrics.py,sha256=w8tGe2tTbBNz9A1TNZF3jSpxcNC6QvFP5I0lWRd0Nw4,20398
|
|
10
|
-
nextrec/basic/model.py,sha256=
|
|
10
|
+
nextrec/basic/model.py,sha256=mtVttDWmrhdW-L1PAelJ90a1BW0q6bzG9roMvrPTU0U,66342
|
|
11
11
|
nextrec/basic/session.py,sha256=2kogEjgKAN1_ygelbwoqOs187BAcUnDTqXG1w_Pgb9I,4791
|
|
12
|
-
nextrec/data/__init__.py,sha256=
|
|
12
|
+
nextrec/data/__init__.py,sha256=HLnARJrqDEVPTcofPSAEimy2Oj15vbomj-7UvT4ze_4,767
|
|
13
13
|
nextrec/data/data_utils.py,sha256=vGZ378YM_JQXO9npRB7JqojJx1ovjbJCWI-7lQJkicA,6298
|
|
14
|
-
nextrec/data/dataloader.py,sha256=
|
|
15
|
-
nextrec/data/preprocessor.py,sha256=
|
|
14
|
+
nextrec/data/dataloader.py,sha256=LAKpcSHhq53scq8PKwF8uqxa8wQLG0FshjY3TQwIvBU,20459
|
|
15
|
+
nextrec/data/preprocessor.py,sha256=N7m4PYGZE6AND0XyYRvXKYAUub9aHGb1qmxbBRxlZKA,42294
|
|
16
16
|
nextrec/loss/__init__.py,sha256=t-wkqxcu5wdYlrb67-CxX9aOGom0CpMJK8Fe8KGDSEE,857
|
|
17
17
|
nextrec/loss/listwise.py,sha256=LcYIPf6PGRtjV_AoWaAyp3rse904S2MghE5t032I07I,5628
|
|
18
18
|
nextrec/loss/loss_utils.py,sha256=LnTkpMTS2bhbq4Lsjf3AUn1uBaOg1TaH5VO2R8hwARc,5324
|
|
@@ -47,7 +47,7 @@ nextrec/utils/__init__.py,sha256=6x3OZbqks2gtgJd00y_-Y8QiAT42x5t14ARHQ-ULQDo,350
|
|
|
47
47
|
nextrec/utils/embedding.py,sha256=yxYSdFx0cJITh3Gf-K4SdhwRtKGcI0jOsyBgZ0NLa_c,465
|
|
48
48
|
nextrec/utils/initializer.py,sha256=ffYOs5QuIns_d_-5e40iNtg6s1ftgREJN-ueq_NbDQE,1647
|
|
49
49
|
nextrec/utils/optimizer.py,sha256=85ifoy2IQgjPHOqLqr1ho7XBGE_0ry1yEB9efS6C2lM,2446
|
|
50
|
-
nextrec-0.2.
|
|
51
|
-
nextrec-0.2.
|
|
52
|
-
nextrec-0.2.
|
|
53
|
-
nextrec-0.2.
|
|
50
|
+
nextrec-0.2.3.dist-info/METADATA,sha256=SpkwkLdg4MQLeysCCr_0fJXak-Vo139Cz3HFLXR-4Z0,11425
|
|
51
|
+
nextrec-0.2.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
52
|
+
nextrec-0.2.3.dist-info/licenses/LICENSE,sha256=2fQfVKeafywkni7MYHyClC6RGGC3laLTXCNBx-ubtp0,1064
|
|
53
|
+
nextrec-0.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|