зеркало из https://github.com/mozilla/bugbug.git
Родитель
9ff32ffed6
Коммит
9575a43e3e
|
@ -177,7 +177,9 @@ class BaseSimilarity(abc.ABC):
|
|||
return
|
||||
|
||||
def save(self):
|
||||
joblib.dump(self, f"{self.__class__.__name__.lower()}.similaritymodel")
|
||||
path = f"{self.__class__.__name__.lower()}.similaritymodel"
|
||||
joblib.dump(self, path)
|
||||
return path
|
||||
|
||||
@staticmethod
|
||||
def load(model_file_name):
|
||||
|
|
|
@ -5,12 +5,14 @@
|
|||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
from logging import INFO, basicConfig, getLogger
|
||||
|
||||
from sklearn.feature_extraction.text import TfidfVectorizer
|
||||
|
||||
from bugbug import bugzilla, db, similarity
|
||||
from bugbug.utils import zstd_compress
|
||||
|
||||
basicConfig(level=INFO)
|
||||
logger = getLogger(__name__)
|
||||
|
@ -58,7 +60,9 @@ def main():
|
|||
cleanup_urls=args.cleanup_urls, nltk_tokenizer=args.nltk_tokenizer
|
||||
)
|
||||
|
||||
model.save()
|
||||
path = model.save()
|
||||
assert os.path.exists(path)
|
||||
zstd_compress(path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Загрузка…
Ссылка в новой задаче