зеркало из https://github.com/mozilla/bugbug.git
Download bugs DB in the similarity trainer script (#937)
This commit is contained in:
Родитель
6181dd11af
Коммит
477807e6e4
|
@ -6,10 +6,14 @@
|
|||
|
||||
import argparse
|
||||
import sys
|
||||
from logging import INFO, basicConfig, getLogger
|
||||
|
||||
from sklearn.feature_extraction.text import TfidfVectorizer
|
||||
|
||||
from bugbug import similarity
|
||||
from bugbug import bugzilla, db, similarity
|
||||
|
||||
basicConfig(level=INFO)
|
||||
logger = getLogger(__name__)
|
||||
|
||||
|
||||
def parse_args(args):
|
||||
|
@ -37,6 +41,12 @@ def parse_args(args):
|
|||
|
||||
def main():
|
||||
args = parse_args(sys.argv[1:])
|
||||
|
||||
logger.info("Downloading bugs database...")
|
||||
|
||||
if db.is_old_version(bugzilla.BUGS_DB) or not db.exists(bugzilla.BUGS_DB):
|
||||
db.download(bugzilla.BUGS_DB, force=True)
|
||||
|
||||
if args.algorithm == "neighbors_tfidf_bigrams":
|
||||
model = similarity.model_name_to_class[args.algorithm](
|
||||
vectorizer=TfidfVectorizer(ngram_range=(1, 2)),
|
||||
|
|
Загрузка…
Ссылка в новой задаче