Giter Site home page Giter Site logo

mshirshekar / nlp-response-query Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 280 KB

NLP response query with cosine similarity of documents' tf-idf vectors

Jupyter Notebook 100.00%
cosine-similarity lemmatization nlp query-response stemming stopwords tf-idf-vectors information-retrieval

nlp-response-query's Introduction

Information Retrieval Course Project

In this project, there are two steps to return names of 10 highest similarity books with desired query.

Firstly, download the dataset from https://github.com/mohamad-dehghani/persian-pdf-books-dataset and, this dataset contains information on Persian pdf books. Furthermore, the dataset consists of information about 2428 books with six features namely title, date, content, category, author, and comments, but actually I just use title and content of books in this project and, this step includes two phases namely Pre-processing and Inverted indexing. In the pre-processing phase, methods such as normalization, removal of stop words, stemming, and lemmatization applies to the book's content feature, which is reasonable and necessary from my point of view, and stores it. In the Inverted indexing phase, I should invert indexing the final token extracted from the pre-processing phase for each book like the below image.

img_1.png

Secondly, I write ten queries related to the book's content feature manually then apply Pre-processing phase to these queries and, I append queries to the dataset's content feature to create a vector with one dimension (2438 * 1) and then calculate the tf-idf score for each word in vector and for each record. after obtaining the vector representation tf-idf, return names of 10 books that has the highest cosine similarity with desired query (I calculate the cosine similarity of each query and all books' content). To sum up, I return names of 10 highest similar books with each of the queries

nlp-response-query's People

Contributors

mshirshekar avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.