loading...

Discussion on: Compare documents similarity using Python | NLP

Collapse
saineenihar profile image
Nihar Sainee

It is giving an error while calling this piece of code

perform a similarity query against the corpus

query_doc_tf_idf = tf_idf[query_doc_bow]

print(document_number, document_similarity)

print('Comparing Result:', sims[query_doc_tf_idf])

error is :
FileNotFoundError: [Errno 2] No such file or directory: 'workdir/.0'
Can anyone help

Collapse
zz161 profile image
Zhuangdie(Alan) Zhou

building the index

sims = gensim.similarities.Similarity('workdir/',tf_idf[corpus],
num_features=len(dictionary))
Change the 'workdir/' to your directory where your python script is located