pytorch / text

Models, data loaders and abstractions for language processing, powered by PyTorch
https://pytorch.org/text
BSD 3-Clause "New" or "Revised" License
3.48k stars 815 forks source link

Any guideline on load a pretrained Pytorch NLP model to evaluate new dataset #731

Open zorozy opened 4 years ago

zorozy commented 4 years ago

❓ Questions and Help

Description Hi,

I am very new to NLP and would like to ask a very stupid question.

After I trained one NLP model, like GRU, what should I save and how could I reload the model again later on a new test dataset?

Besides, what should I do to record the prediction result for each input in the original sequence?

I am so sorry for this baby question.

pratikkejriwal commented 3 years ago

don't know if you are still looking for an answer, but here are few steps that you can follow:

as for recording the prediction result of each input (I am assuming you want results for each epoch), you can store those data inside a list:

epoch_data.append([epoch, loss.data.item(), accuracy])

if you want, you can refer to my repository, for further examples/information.