Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created April 21, 2019 12:21
Show Gist options
  • Save prateekjoshi565/187b95c55d5d4789fb1d33075d17564b to your computer and use it in GitHub Desktop.
Save prateekjoshi565/187b95c55d5d4789fb1d33075d17564b to your computer and use it in GitHub Desktop.
genre_inference
def infer_tags(q):
q = clean_text(q)
q = remove_stopwords(q)
q_vec = tfidf_vectorizer.transform([q])
q_pred = clf.predict(q_vec)
return multilabel_binarizer.inverse_transform(q_pred)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment