We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 150ce69 commit 64bfc99Copy full SHA for 64bfc99
1 file changed
pythainlp/tokenize/han_solo.py
@@ -124,16 +124,18 @@ def featurize(
124
125
# Convert to the requested return type
126
if return_type == "list":
127
- all_features: list[list[str]] = all_features_list
128
- all_labels: list[str] = [str(label) for label in all_labels_int]
+ return {
+ "X": all_features_list,
129
+ "Y": [str(label) for label in all_labels_int]
130
+ }
131
else:
- all_features: list[dict[str, int]] = [
- {key: 1 for key in feature_list}
132
- for feature_list in all_features_list
133
- ]
134
- all_labels: list[int] = all_labels_int
135
-
136
- return {"X": all_features, "Y": all_labels}
+ "X": [
+ {key: 1 for key in feature_list}
+ for feature_list in all_features_list
+ ],
137
+ "Y": all_labels_int
138
139
140
141
_to_feature = Featurizer()
0 commit comments