Generate Tags for a text given
I am trying to build an API using flask which will extract the text from a url given and generate valid tags for that text. Say for example, the text is for a recipe of chicken curry, valid tags can be recipe, Indian Cuisine, food etc.
How can I implement regression after multi-label classification(multi-class classification)?
I have a dataset where some objects (15%) belong to different classes and have a property value for each of those classes. How can I make a model that predicts multi-label or multi-class and then make a regression prediction based on the output of the classifier? I also need to output the probabilities for each class. unfortunately I can’t delete this 15%.
enter image description here
Kernel crashed while stemming process
im using this function to do sentence stemming
identifying and Extracting particular statements
Given a document that has exclusion statement like”all documents provided to evidence no Indonesia vessels invovled”.i want to identify such statements from documents and then extract the country using ML models. I
I want to predict tags when input the questions
`Question = “facetgrid data label seaborn”
Tags = “python pandas seaborn”
I use MLPClassifier in small dataset but real dataste shape is 262529. Which algoridam is use for this. I provide my code
from sklearn.neural_network import MLPClassifier
from sklearn.feature_extraction.text
import CountVectorizer
from sklearn.model_selection
import train_test_split
from sklearn.metrics
import accuracy_score
df_half = df.iloc[:int(len(df)*0.1)]q = df_half['Question']t = [tags.split() for tags in df_half['Tags']]vectorizer = CountVectorizer()X_vectorized1 = vectorizer.fit_transform(q)label_binarizer = MultiLabelBinarizer()y_binarized1 = label_binarizer.fit_transform(t)X_train1, X_test1, y_train1, y_test1 = train_test_split(X_vectorized1, y_binarized1, test_size=0.2, random_state=42)classifier = MLPClassifier(hidden_layer_sizes=(100,), max_iter=100, alpha=0.0001,solver='adam', verbose=10, random_state=42, tol=0.0001)classifier.fit(X_train1, y_train1)y_pred1 = classifier.predict(X_train1)
accuracy = accuracy_score(y_train1, y_pred1)
print(“Accuracy:”, accuracy)
Accuracy : 0.9964`
how to map the job titles into broad categories
if there are 3 people: A, B, C