dmmiller612 / bert-extractive-summarizer

Easy to use extractive text summarization with BERT
MIT License
1.37k stars 307 forks source link

How to use cached sentence embedding vector as the input instead of text? #140

Open Visla-Melinda-Devins opened 1 year ago

Visla-Melinda-Devins commented 1 year ago

Hi, we have multiple tasks that use SBERT sentence embedding, therefore we embed the text once and cache the sentence embedding vectors, then re-use the vectors everywhere. We found it really improve the time performance of our applications.

Is there a way for the model to take sentence embedding vectors as the input instead of text? The following is how we use the model. Thank you

model = SBertSummarizer('all-mpnet-base-v2') sum_3sent = model(text_prefer_sentence_vectors, num_sentences=3)