我從事客戶支持工作,在給定一組培訓(xùn)票證的情況下,我正在使用scikit-learn來預(yù)測我們機(jī)票的標(biāo)簽(培訓(xùn)集中約40,000張票證)。我正在使用基于此模型的分類模型。即使訓(xùn)練集中的所有票證都沒有標(biāo)簽,它也只是將“()”作為我的許多票證測試組的標(biāo)簽進(jìn)行預(yù)測。我的標(biāo)簽訓(xùn)練數(shù)據(jù)是一個(gè)列表列表,例如:tags_train = [['international_solved'], ['from_build_guidelines my_new_idea eligibility'], ['dropbox other submitted_faq submitted_help'], ['my_new_idea_solved'], ['decline macro_backer_paypal macro_prob_errored_pledge_check_credit_card_us loading_problems'], ['dropbox macro__turnaround_time other plq__turnaround_time submitted_help'], ['dropbox macro_creator__logo_style_guide outreach press submitted_help']]雖然我的票務(wù)說明訓(xùn)練數(shù)據(jù)只是一個(gè)字符串列表,例如:descs_train = ['description of ticket one', 'description of ticket two', etc]這是構(gòu)建模型的代碼的相關(guān)部分:import numpy as npimport scipyfrom sklearn.pipeline import Pipelinefrom sklearn.feature_extraction.text import CountVectorizerfrom sklearn.feature_extraction.text import TfidfTransformerfrom sklearn.multiclass import OneVsRestClassifierfrom sklearn.svm import LinearSVC# We have lists called tags_train, descs_train, tags_test, descs_test with the test and train dataX_train = np.array(descs_train)y_train = tags_trainX_test = np.array(descs_test) classifier = Pipeline([ ('vectorizer', CountVectorizer()), ('tfidf', TfidfTransformer()), ('clf', OneVsRestClassifier(LinearSVC(class_weight='auto')))])classifier.fit(X_train, y_train)predicted = classifier.predict(X_test)但是,“預(yù)測”給出的列表如下:predicted = [(), ('account_solved',), (), ('images_videos_solved',), ('my_new_idea_solved',), (), (), (), (), (), ('images_videos_solved', 'account_solved', 'macro_launched__edit_update other tips'), ('from_guidelines my_new_idea', 'from_guidelines my_new_idea macro__eligibility'), ()]我不明白為什么訓(xùn)練集中沒有空白()的原因。它不應(yīng)該預(yù)測最接近的標(biāo)簽嗎?誰能推薦我正在使用的模型的任何改進(jìn)?非常感謝您的提前幫助!
添加回答
舉報(bào)
0/150
提交
取消