thanks in advance for reading.
I'm in Python and using spaCy for processing English text. I have a phrase that I want to search for
search_phrase = "payment date"
in a larger phrase
text_to_be_searched = "Party A will pay Party B on the transaction date."
And I want the search to match "payment date" with "transaction date" based on similarity.
How can I do this? I don't see an obvious way, and the only thing I can think of is to manually split text_to_be_searched into chunks. One extra difficulty here is that the matching phrases could have different numbers of tokens, so I'd have to break it into chunks of 1, 2, ... 5 tokens and search each chunk in each set of chunks. For clarity, this would be:
Set of 1-token chunks:
['Party','A','will', ..., 'date']
Set of 2-token chunks:
['Party A','A will','will pay', ..., 'transaction date']
etc