如何提取与示例句子列表相比具有相似 meaning/intent 的句子

How to extract sentences which has similar meaning/intent compared against a example list of sentences

我在客户和顾问之间有聊天互动 [话语],我想知道顾问互动是否包含以下列表中的特定句子或类似句子:

我在顾问互动中寻找的例句

["I would be more than happy to help you with this",
"I would be happy to look over the account to see how I can help get this sorted out for you",
"I’d be more than happy to look into this for you!",
"Oh, I see, let me assist you with this concern.",
"I am more than happy to do everything I can to resolve this matter for you.",
"I would be happy to look over the account to see how I can help get this sorted out for you.",
"I am happy to have a look."]


I have a dataset which contains the list of interaction_id and Utterances(Sample below)

```Example Chat interaction between Advisor and CLient : 
Client : Hello I would like to place an order for replacement battery
Agent: Hi Welcome to Battery service department. I would be happy to help you with your battery replacement Order.

如何get/Extract具有相似意图或意义的句子。 我是 NLP 的新手,我相信我手头有一个句子 classification/Extraction 问题,想知道有什么方法可以实现我需要的

基本上我正在努力实现以下目标:

ID    Utt                                               Help_Stmt_Present

IRJST   Hi Welcome to Battery service department. 
        I would be happy to help you with your battery
        replacement Order.                                     Yes 


可以通过多种方式分多个步骤执行此操作:
1。计算句向量

a. Using pretrained word embeddings(glove, word2vec, fasttext, etc) and calculating word embeddings for each word and then average it across words of the sentence to calculate the sentence embedding.

b. Use Universal Sentence Encoder to get the sentence embeddings.

2。计算相似度匹配

a. Calculate the distance between between the target and all other N sentences using euclidean or cosine or any other distance metric that works best for your problem.

b. Train a KNN model with N sentence vectors you have and apply K-NN prediction with the target sentence to get K most similar sentences.

为了获得更好的结果,您可以使用基于深度学习的技术和 SOTA 架构,例如转换器和基于它构建的架构。您可以查看 this repository which solves your task using transformers. Also to play with different architectures and other NLP tasks you can checkout the Hugging Face Repository