import spacy
import scispacy
nlp = spacy.load('en_core_sci_lg')
for text1 in df1['priceDescription']:
doc1 = nlp(text1)
for text2 in df2['Description']:
doc2 = nlp(text2)
similarity = doc1.similarity(doc2)
#print(doc1.text, doc2.text, similarity)
output = (f'{doc1.text:26} | {doc2.text:26} | {similarity:.2}')
print(output)
This is my code so how I can store the above function in the list so that I can store a list in one variable.
Output may be something like this
mylist = [for text1 in df1['priceDescription'].....]
I want output above format
can anyone help me please to solve this problem?
Thank You.