Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.model_selection import train_test_split
- from nltk.corpus import stopwords
- from RMDL import text_feature_extraction as txt
- from RMDL import RMDL_Text as RMDL
- nltk.download('stopwords')
- nltk.download('punkt')
- articles_text = [txt.text_cleaner(a, deep_clean=True) for a in articles['text'].values]
- np.random.seed(7)
- X_train, X_test, y_train, y_test = train_test_split(articles_text, labels, test_size=0.2, random_state=4)
- batch_size = 64
- sparse_categorical = 0
- n_epochs = [50, 50, 50] ## DNN--RNN-CNN
- Random_Deep = [3, 3, 3] ## DNN--RNN-CNN
- RMDL.Text_Classification(X_train, y_train, X_test, y_test,
- batch_size=batch_size,
- sparse_categorical=sparse_categorical,
- random_deep=Random_Deep,
- epochs=n_epochs,
- GloVe_file='/content/glove.6B.50d.txt',
- random_optimizor=False,
- plot=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement