-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flair Regression #564
Flair Regression #564
Conversation
Hello @alanakbik and @rnditdev, |
Hi @heukirne it looks good. However, I ran the current code with the following script: # get corpus
corpus = NLPTaskDataFetcher.load_corpus(NLPTask.REGRESSION, 'tests/resources/tasks')
# init document embeddings
document_embeddings: DocumentRNNEmbeddings = DocumentRNNEmbeddings(
[WordEmbeddings('glove'),
FlairEmbeddings('news-forward', use_cache=True),
FlairEmbeddings('news-backward', use_cache=True)],
128, 1, False, 64, False, False)
# init regressor
model = TextRegressor(document_embeddings, Dictionary(), False)
# train
trainer = RegressorTrainer(model, corpus)
trainer.train('resources/taggers/regression',
max_epochs=150,
mini_batch_size=4,
embeddings_in_memory=True,
) and it gave me the following results for the final model after 72 epochs: AVG: mse 0.021794370514728552 - mae 0.13093452751636503 - pearson -1.0 - spearman -0.9999999999999999 Is this correct? In particular, the pearson and spearman numbers look odd. Are you getting similar results? |
Hello @alanakbik, yes, I got a similar result: glove_embedding: WordEmbeddings = WordEmbeddings('glove')
document_embeddings: DocumentRNNEmbeddings = DocumentRNNEmbeddings([glove_embedding], 128, 1, False, 64, False, False)
modelR = TextRegressor(document_embeddings, Dictionary(), False)
trainerR = RegressorTrainer(modelR, corpus)
trainerR.train('regression_train/', max_epochs=150, mini_batch_size=4, embeddings_in_memory=True) after 75 epochs AVG: mse 0.04095809102497722 - mae 0.1944224864244461 - pearson 0.7231063539038256 - spearman 0.39999999999999997 Seems an possible result. Is a little weird the negative result in pearson and spearman, but probably the corpus is upside-down. There is something wrong with the corpus files, probably the test is part of train. |
@heukirne Ok! Could you double-check the corpus and the implementation before we merge? |
TODO: still need a self-contained MSE and MAE metric
add mean squared error as default for regression
Hello @alanakbik, I re-run the tests and add a new evaluation metric name. |
Cool, thanks! |
still need unit test for MetricRegression
Hi @alanakbik , now the MetricRegression object is more compatible with the Metric one. The results now is working properly (I fix a problem when add MetricRegression). |
@heukirne thanks! It looks like the new unit tests for the regressor are failing as of the last commit, with the message:
You probably need to define the logger in the class first. |
@alanakbik, my bad, now it's fixed! ;) |
thanks :) |
👍 |
@heukirne sorry for the delay - only now got back from my vacation. I ran some tests and I think we're good to go to add this as a beta feature. We're planning a refactoring of the |
👍 |
Excelent, @alanakbik ! |
👍 |
👍 |
GH-564: regression datasets
Building model and trainer for regression task with Flair framework #440
Still need some improvements: