mednli icon indicating copy to clipboard operation
mednli copied to clipboard

Load our pre-trained model

Open MinuteswithMetrics opened this issue 5 years ago • 2 comments

Thank you for providing medmli! I was wondering if you could assist me by telling me how could I run your code like InferSent demo.pynb?

https://github.com/DAVEZJ/Simple_Sentence_Simliarity/blob/0f564adedad62f1bbe13265ca3848d98e8b363f6/Simple_Sentence_Similarity.ipynb

MinuteswithMetrics avatar Jul 18 '19 20:07 MinuteswithMetrics

Hi,

What is the problem exactly? The InferSent model is available in this repository: https://github.com/jgc128/mednli_baseline

jgc128 avatar Jul 22 '19 16:07 jgc128

I am trying to figure out how I can run your scripts with code line below.

if FULL:
    import torch
    from models import InferSent
    V = 1
    MODEL_PATH = 'encoder/infersent1.pkl'
    params_model = {'bsize': 64, 'word_emb_dim': 300, 'enc_lstm_dim': 2048,
                    'pool_type': 'max', 'dpout_model': 0.0, 'version': V}
    infersent = InferSent(params_model)
    infersent.load_state_dict(torch.load(MODEL_PATH))
    infersent.set_w2v_path(PATH_TO_GLOVE)

Here is the notebook that I plan to use:

Simple Sentence Similarity

MinuteswithMetrics avatar Jul 22 '19 21:07 MinuteswithMetrics