We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I achieved a score of 34 using TF-IDF with cosine_similarity from scikit-learn. I fit the TF-IDF vectorizer on the context text, questions, and answers, and then transformed each sentence in the context individually, along with the questions and answers. After that, I computed the cosine similarity between each sentence vector and the question vectors, as well as between each sentence vector and the answer vectors. Finally, I took the product of both similarity scores to evaluate relevance.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Matching Questions with their Answers
You are viewing a single comment's thread. Return to all comments →
I achieved a score of 34 using TF-IDF with cosine_similarity from scikit-learn. I fit the TF-IDF vectorizer on the context text, questions, and answers, and then transformed each sentence in the context individually, along with the questions and answers. After that, I computed the cosine similarity between each sentence vector and the question vectors, as well as between each sentence vector and the answer vectors. Finally, I took the product of both similarity scores to evaluate relevance.