Skip to content

Instantly share code, notes, and snippets.

@alabrashJr
Last active June 10, 2020 11:22
Show Gist options
  • Save alabrashJr/a874d6243c8e9f9659cbc8e8d216c7de to your computer and use it in GitHub Desktop.
Save alabrashJr/a874d6243c8e9f9659cbc8e8d216c7de to your computer and use it in GitHub Desktop.
def predict(text):
print("text -> ",text)
text_s=[stemmer.stem(w) for w in text.split()]
print("text stemmed-> ",text_s)
X=vectorizer.transform([text_s])
X_pred=lp_classifier.predict(X).toarray()
return [data.columns[i] for i,x in enumerate(X_pred[0]) if x==1]
text="araçım servise son getirmediğimde düzgün tamir edilmedi memnun değil"
predict(test_txt)
#text -> Araç servis son getirdigimde düzgü tamir edilmedi memnu değilim.
#['Kalite']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment