Skip to content

Commit cc3a2d1

Browse files
authored
Add docs to param_free.py
1 parent 1f480b1 commit cc3a2d1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pythainlp/cls/param_free.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ def train(self):
3737
)
3838
return Cx2_list
3939

40-
def predict(self, x1: str, k: int = 1):
40+
def predict(self, x1: str, k: int = 1) -> str:
41+
"""
42+
:param str x1: the text that want to predict label.
43+
:param str k: k
44+
:return: label
45+
:rtype: str
46+
"""
4147
Cx1 = len(gzip.compress(x1.encode("utf-8")))
4248
disance_from_x1 = []
4349
for i in range(len(self.Cx2_list)):

0 commit comments

Comments
 (0)