I am new to tensorflow and machine learning. I am facing issues with writing a tensorflow code which does the text classification similar to one I tried using sklearn libraries. I am facing major issues with vectorising the dataset and providing the input to tensorflow layers.
I do remember being successful in one hot encoding the labels but the tensorflow layer ahead did not accept the created array. Please note, I have read majority of text clasification answered questions on stackoverflow but they are too specific or have complex needs to resolve. My problem case is too narrow and requires very basic solution.
It would be great help if anyone could tell me the steps or tensorflow code similar to my sklearn machine learning algorithm.
Dataset used is avaialable at : https://www.kaggle.com/virajgala/classifying-text
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.linear_model import SGDClassifier
from sklearn.pipeline import Pipeline
#Reading the csv dataset
df = pd.read_csv(('/Classifyimg_text.csv'), index_col=False).sample(frac=1)
#Splitting the dataset
train_data, test_data, train_labels, test_labels = train_test_split(df['sentence'], df['label'], test_size=0.2)
#Vectorization and Classification
streamline = Pipeline([('vect', TfidfVectorizer(max_features=int(1e8))),
('clf', SGDClassifier())]).fit(train_data, train_labels)
#Prediction
Output = streamline.predict(["This is my action to classify the text."])