albanie / collaborative-experts

Video embeddings for retrieval with natural language queries
https://www.robots.ox.ac.uk/~vgg/research/collaborative-experts/
Apache License 2.0
332 stars 55 forks source link

about text feature extract #12

Closed zqlearning closed 4 years ago

zqlearning commented 4 years ago

I am trying to extract text feature using 'sent_feat_demo.py' or modules in 'model/text.py', but extracting one by one is pretty slowly when use 'openai' style,especially when I have to deal with lots of sentence.

could you give me some advice or tell me how you do that?

thank you very much.

jerome-labonte-udem commented 4 years ago

Maybe you are reloading the model everytime ? Try to instanciate an models.text.OpenAI_GPT model and use its text2vec method instead. You might have to delete the "dim" parameter from the parent TextEmbedding class init method first as it is not passed by the OpenAI_GPT init method and is unused anyway.

zqlearning commented 4 years ago

thank you. I have solved my problem.