at first i was getting this error
ERROR: datascience 0.10.6 has requirement folium==0.2.1, but you'll have folium 0.8.3 which is incompatible.
which i resolved using this code
!pip install --upgrade git+https://github.com/flairNLP/flair.git
then after doing that it gave me out out for the pre trained model
so i moved to the custom trained model
import pandas as pd
data = pd.read_csv("./spam.csv", encoding='latin-1').sample(frac=1).drop_duplicates()
data = data[['v1', 'v2']].rename(columns={"v1":"label", "v2":"text"})
data['label'] = 'label' + data['label'].astype(str)
data.iloc[0:int(len(data)0.8)].to_csv('train.csv', sep='\t', index = False, header = False)
data.iloc[int(len(data)0.8):int(len(data)0.9)].to_csv('test.csv', sep='\t', index = False, header = False)
data.iloc[int(len(data)0.9):].to_csv('dev.csv', sep='\t', index = False, header = False);
i ran the above code .after running the code it created train.csv,test.csv and dev.csv
so i moved to the next part of the code that starts the training process
this is the code below
from flair.data_fetcher import NLPTaskDataFetcher
from flair.embeddings import WordEmbeddings, FlairEmbeddings, DocumentLSTMEmbeddings
from flair.models import TextClassifier
from flair.trainers import ModelTrainer
from pathlib import Path
corpus = NLPTaskDataFetcher.load_classification_corpus(Path('./'), test_file='test.csv', dev_file='dev.csv', train_file='train.csv')
word_embeddings = [WordEmbeddings('glove'), FlairEmbeddings('news-forward-fast'), FlairEmbeddings('news-backward-fast')]
document_embeddings = DocumentLSTMEmbeddings(word_embeddings, hidden_size=512, reproject_words=True, reproject_words_dimension=256)
classifier = TextClassifier(document_embeddings, label_dictionary=corpus.make_label_dictionary(), multi_label=False)
trainer = ModelTrainer(classifier, corpus)
trainer.train('./', max_epochs=10)
after i start running the above code this is wat i get
at first i was getting this error ERROR: datascience 0.10.6 has requirement folium==0.2.1, but you'll have folium 0.8.3 which is incompatible. which i resolved using this code !pip install --upgrade git+https://github.com/flairNLP/flair.git
then after doing that it gave me out out for the pre trained model so i moved to the custom trained model
import pandas as pd data = pd.read_csv("./spam.csv", encoding='latin-1').sample(frac=1).drop_duplicates() data = data[['v1', 'v2']].rename(columns={"v1":"label", "v2":"text"})
data['label'] = 'label' + data['label'].astype(str) data.iloc[0:int(len(data)0.8)].to_csv('train.csv', sep='\t', index = False, header = False) data.iloc[int(len(data)0.8):int(len(data)0.9)].to_csv('test.csv', sep='\t', index = False, header = False) data.iloc[int(len(data)0.9):].to_csv('dev.csv', sep='\t', index = False, header = False);
i ran the above code .after running the code it created train.csv,test.csv and dev.csv so i moved to the next part of the code that starts the training process this is the code below from flair.data_fetcher import NLPTaskDataFetcher from flair.embeddings import WordEmbeddings, FlairEmbeddings, DocumentLSTMEmbeddings from flair.models import TextClassifier from flair.trainers import ModelTrainer from pathlib import Path corpus = NLPTaskDataFetcher.load_classification_corpus(Path('./'), test_file='test.csv', dev_file='dev.csv', train_file='train.csv') word_embeddings = [WordEmbeddings('glove'), FlairEmbeddings('news-forward-fast'), FlairEmbeddings('news-backward-fast')] document_embeddings = DocumentLSTMEmbeddings(word_embeddings, hidden_size=512, reproject_words=True, reproject_words_dimension=256) classifier = TextClassifier(document_embeddings, label_dictionary=corpus.make_label_dictionary(), multi_label=False) trainer = ModelTrainer(classifier, corpus) trainer.train('./', max_epochs=10) after i start running the above code this is wat i get
Originally posted by @pablomascarenhas27 in https://github.com/thstkdgus35/EDSR-PyTorch/issues/185#issuecomment-632633718