Skip to content

Commit 0195965

Browse files
committed
Reduce import time (pythainlp.tag._tag_perceptron)
1 parent 39c51fc commit 0195965

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pythainlp/tag/_tag_perceptron.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414
1515
This tagger is provided under the terms of the MIT License.
1616
"""
17-
18-
from __future__ import absolute_import
19-
2017
import json
21-
import random
2218
from collections import defaultdict
2319
from typing import Dict, Iterable, List, Tuple, Union
2420

@@ -160,6 +156,7 @@ def train(
160156
location.
161157
:param nr_iter: Number of training iterations.
162158
"""
159+
import random
163160
self._make_tagdict(sentences)
164161
self.model.classes = self.classes
165162
for _ in range(nr_iter):

0 commit comments

Comments
 (0)