7

私はカスタマー サポートで働いており、チケットのトレーニング セット (トレーニング セットには約 40,000 チケット) が与えられた場合に、scikit-learn を使用してチケットのタグを予測しています。

これに基づいた分類モデルを使用しています。トレーニング セットのチケットにタグがないにもかかわらず、チケットの多くのテスト セットのタグとして "()" だけを予測しています。

タグのトレーニング データは、次のようなリストのリストです。

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']]

チケットの説明のトレーニング データは単なる文字列のリストですが、たとえば次のようになります。

descs_train = ['description of ticket one', 'description of ticket two', etc]

モデルを構築するためのコードの関連部分は次のとおりです。

import numpy as np
import scipy
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.multiclass import OneVsRestClassifier
from sklearn.svm import LinearSVC

# We have lists called tags_train, descs_train, tags_test, descs_test with the test and train data

X_train = np.array(descs_train)
y_train = tags_train
X_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)

ただし、「予測」は次のようなリストを提供します。

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'), ()]

トレーニング セットに何もないのに、空白 () を予測する理由がわかりません。最も近いタグを予測するべきではありませんか? 私が使用しているモデルの改善を推奨できる人はいますか?

事前に助けてくれてありがとう!

4

2 に答える 2