GithubHelp home page GithubHelp logo

federico2001 / transformer_based_ir Goto Github PK

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

Information Retrieval (IR) process that categorizes text using Transformers and NLP techniques

Dockerfile 5.48% Jupyter Notebook 94.52%

transformer_based_ir's Introduction

Transformer Based Information Retrieval (IR) System

In this project, we prototype the IR product that will recieve an input string and return the most relevant offers to the user with respect to that code. It uses a transformer model for text classification to detect the type of query, then depending on the type, it applies a series of procedures to find the best match (text similarity using TF-IDF, cosine similarity, stemming and lemmatization, "fuzzy" similarity, data augmentation (through synonym generation)

These are the steps taken to achieve this:

  • Load libraries and define functions.
  • Given an input text, get the category classified by our TypeDetector service which we consume through an API.
  • Depending on the response (0 = Retail, 1 = Brand, 2 = Category) we perform a specific treatment.
  • If the type of query is 0 or 1, we search for a match with our unique retailers or brands by performing TF-IDF and Cosine Similarity.
  • Also, we compute a 'fuzzy similarity score' in case there are typeos, which can be helpful if the cosine similarity doesn't bring relevant results.
  • Next, we fetch offers that come from our matched retailers or brands, only if the cosine similarity is > 0.4 or the fuzzy similarity is > 0.75
  • If the type of query is 2, then the similarity of the term is compared to offers directly, and synonyms of the terms are computed and also compared to the offers to contemplate a wider range of relevant results.
  • Finally, the relevant offers are returned in a json list along with a log of activity.

*DEPLOYMENT: The deployment project can be found in this repository.

transformer_based_ir's People

Contributors

federico2001 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.