What pipeline best fits the below use case for similarity scoring of two texts? #2328
Replies: 2 comments 2 replies
-
Hi @asharm0662 and first of all sorry that it’s taken this long to answer this. To better understand what might be the best solution for you could you give me some more detail about your use-case? Are you wanting to achieve a pipeline that finds similarities to a given sentence in a set of documents? The reason I’m asking is I’m trying to understand whether you need a document store at all. The SentenceTransformersRanker might be what you're looking for. For example to be used on top of a retriever to rank the most relevant. But again this depends if this is what you're trying to achieve. If you can fill me in a bit further I'll be happy to help out! |
Beta Was this translation helpful? Give feedback.
-
Hi @asharm0662 , first of all so sorry for the late reply, it seems I'm not notified about these. From what I'm seeing, if you only want to be able to compare two documents, in which case the SentenceTransformerRanker in a pipeline would indeed make sense but there's not a straight forward way of being able to provide two documents as input to the pipeline. Instead, you can have a DocumentStore with some of the documents already there and provide the second one as input, then you can get to see which documents in DocumentStore it is most similar to. If, however, you want to be able to just compare 2 bits of text and see if they are similar, I would say a pipeline makes less sense and picking a sentence similarity model from HuggingFace and using just that as is. |
Beta Was this translation helpful? Give feedback.
-
Hi Team,
I am wanting to use haystack to compare the similarity of between two sentences, paragraphs, or documents, vs the semantic searches against FAQ documents, I have been seeing?
For example, is there pipeline that allows me to feed the text as two sentences and get back a similarity score only?:
Similarity: .9082
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions